Пример #1
0
 private void StoreAddresses(string transactionid, Output txout)
 {
     if (txout != null && txout.scriptPubKey != null && txout.scriptPubKey.addresses != null && txout.scriptPubKey.addresses.Length > 0)
     {
         var addresses = txout.scriptPubKey.addresses.ToList();
         foreach (var address in addresses)
         {
             var addressState = new AddressTxoState {
                 address = address,
                 txo     = transactionid,
                 idx     = txout.n,
             };
             transactionRepository.SetAddressState(addressState);
         }
     }
 }
Пример #2
0
        public void SetAddressState(AddressTxoState state)
        {
            if (state == null)
            {
                return;
            }

            lock (listAdrlock)
            {
                var results = addresses.Where(x => x.address == state.address && x.txo == state.txo && x.idx == state.idx).ToList();

                if (results.Count == 0)
                {
                    addresses.Add(state);
                }
            }
        }