Пример #1
0
 /// <summary>
 /// to keep storage small, only unspents are of interest
 /// </summary>
 /// <param name="txraw"></param>
 private void DeleteSpentFromStore(DecodeRawTransactionResponse txraw)
 {
     if (txraw != null && txraw.vin != null && txraw.vin.Length > 0)
     {
         var inputs = txraw.vin.ToList().Where(tin => !string.IsNullOrWhiteSpace(tin.txid)).ToList();
         foreach (var txin in inputs)
         {
             transactionRepository.DeleteSpentOutputState(txin.txid, txin.vout);
         }
     }
 }
Пример #2
0
 private void ParseVouts(DecodeRawTransactionResponse txraw)
 {
     if (txraw != null && txraw.vout != null && txraw.vout.Length > 0)
     {
         foreach (var txout in txraw.vout)
         {
             StoreOutput(txraw.txid, txout);
             StoreAddresses(txraw.txid, txout);
         }
     }
 }
Пример #3
0
        private void StoreTxState(uint blocktime, uint height, DecodeRawTransactionResponse txraw, RawTransactionResponse tx,
                                  uint index, long offset, uint rawsize)
        {
            var time = blocktime < PeercoinConstants.ProtocolV10SwitchTime && txraw.time.HasValue
                                ? (uint)txraw.time.Value
                                : blocktime;

            var state = new TxState {
                hash     = txraw.txid,
                height   = height,
                offset   = (uint)offset,
                position = index,
                size     = rawsize,
                time     = (uint)txraw.time.Value
            };

            transactionRepository.SetTxState(state);
        }