Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Update MainService.Contracts.cs #769

Merged
merged 3 commits into from
Apr 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions neo-cli/CLI/MainService.Contracts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,19 @@ private void OnInvokeCommand(UInt160 scriptHash, string operation, JArray contra
{
var gas = new BigDecimal(maxGas, NativeContract.GAS.Decimals);
Signer[] signers = Array.Empty<Signer>();
if (signerAccounts != null && !NoWallet())
if (!NoWallet() && sender != null)
{
if (sender != null)
if (signerAccounts == null)
signerAccounts = new UInt160[1] { sender };
else if (signerAccounts.Contains(sender) && signerAccounts[0] != sender)
{
if (signerAccounts.Contains(sender) && signerAccounts[0] != sender)
{
var signersList = signerAccounts.ToList();
signersList.Remove(sender);
signerAccounts = signersList.Prepend(sender).ToArray();
}
else if (!signerAccounts.Contains(sender))
{
signerAccounts = signerAccounts.Prepend(sender).ToArray();
}
var signersList = signerAccounts.ToList();
signersList.Remove(sender);
signerAccounts = signersList.Prepend(sender).ToArray();
}
else if (!signerAccounts.Contains(sender))
{
signerAccounts = signerAccounts.Prepend(sender).ToArray();
}
signers = signerAccounts.Select(p => new Signer() { Account = p, Scopes = WitnessScope.CalledByEntry }).ToArray();
}
Expand Down