Exemple #1
0
 private void AddAccount(NEP6Account account, bool is_import)
 {
     lock (accounts)
     {
         //bool ok = false;
         if (accounts.TryGetValue(account.ScriptHash, out NEP6Account account_old))
         {
             account.Label     = account_old.Label;
             account.IsDefault = account_old.IsDefault;
             account.Lock      = account_old.Lock;
             if (account.Contract == null)
             {
                 account.Contract = account_old.Contract;
             }
             else
             {
                 NEP6Contract contract_old = (NEP6Contract)account_old.Contract;
                 if (contract_old != null)
                 {
                     NEP6Contract contract = (NEP6Contract)account.Contract;
                     contract.ParameterNames = contract_old.ParameterNames;
                     contract.Deployed       = contract_old.Deployed;
                 }
             }
             account.Extra = account_old.Extra;
         }
         else
         {
             indexer?.RegisterAccounts(new[] { account.ScriptHash }, is_import ? 0 : Blockchain.Singleton.Height);
             //ok = true;
         }
         accounts[account.ScriptHash] = account;
         //if (ok)
         //    this.ChangeAccount(WalletAccountChangeEventType.Register, account.ScriptHash);
     }
 }