Skip to content

Commit

Permalink
Update Wallet.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
erikzhang committed Aug 3, 2020
1 parent df0d29c commit 47e8b52
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/neo/Wallets/Wallet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -448,32 +448,32 @@ public bool Sign(ContractParametersContext context)
if (fSuccess) m--;
if (context.Completed || m <= 0) break;
}
continue;
}
else if (account.HasKey)
{
// Try to sign with regular accounts
KeyPair key = account.GetKey();
byte[] signature = context.Verifiable.Sign(key);
fSuccess |= context.AddSignature(account.Contract, key.PublicKey, signature);
continue;
}
}
else
{
// Try Smart contract verification

using var snapshot = Blockchain.Singleton.GetSnapshot();
var contract = snapshot.Contracts.TryGet(scriptHash);
// Try Smart contract verification

if (contract != null)
{
var deployed = new DeployedContract(contract);
using var snapshot = Blockchain.Singleton.GetSnapshot();
var contract = snapshot.Contracts.TryGet(scriptHash);

// Only works with verify without parameters
if (contract != null)
{
var deployed = new DeployedContract(contract);

if (deployed.ParameterList.Length == 0)
{
fSuccess |= context.Add(deployed);
}
// Only works with verify without parameters

if (deployed.ParameterList.Length == 0)
{
fSuccess |= context.Add(deployed);
}
}
}
Expand Down

0 comments on commit 47e8b52

Please sign in to comment.