Skip to content

Commit

Permalink
Code optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
Jin Qiao committed Oct 23, 2019
1 parent 54d2af8 commit a745880
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions neo/Network/P2P/Payloads/Transaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,8 @@ public override int GetHashCode()

public UInt160[] GetScriptHashesForVerifying(Snapshot snapshot)
{
if (Cosigners.Length == 0 || (Cosigners.Length == 1 && Cosigners[0].Account == Sender))
{
return new UInt160[] { Sender };
}

var hashes = new HashSet<UInt160>(Cosigners.Select(p => p.Account));
hashes.UnionWith(new HashSet<UInt160> { Sender });
var hashes = new HashSet<UInt160> { Sender };
hashes.UnionWith(Cosigners.Select(p => p.Account));
return hashes.OrderBy(p => p).ToArray();
}

Expand Down

0 comments on commit a745880

Please sign in to comment.