public void MergeFrom(Coins otherCoin) { var diff = otherCoin.Outputs.Count - this.Outputs.Count; if (diff > 0) { for (int i = 0; i < diff; i++) { Outputs.Add(NullTxOut); } } for (int i = 0; i < otherCoin.Outputs.Count; i++) { Outputs[i] = otherCoin.Outputs[i]; } UpdateValue(); }
public void MergeFrom(Coins otherCoin) { var diff = otherCoin.Outputs.Count - this.Outputs.Count; if (diff > 0) { Outputs.Resize(otherCoin.Outputs.Count); for (int i = 0; i < Outputs.Count; i++) { if (Outputs[i] == null) { Outputs[i] = new TxOut(); } } } for (int i = 0; i < otherCoin.Outputs.Count; i++) { if (!otherCoin.Outputs[i].IsNull) { Outputs[i] = otherCoin.Outputs[i]; } } UpdateValue(); }
public void SetCoins(uint256 txId, Coins coins) { Index.PutAsync(txId.ToString(), coins); }
public void MergeFrom(Coins otherCoin) { var diff = otherCoin.Outputs.Count - this.Outputs.Count; if(diff > 0) { Outputs.Resize(otherCoin.Outputs.Count); for(int i = 0 ; i < Outputs.Count ; i++) { if(Outputs[i] == null) Outputs[i] = new TxOut(); } } for(int i = 0 ; i < otherCoin.Outputs.Count ; i++) { if(!otherCoin.Outputs[i].IsNull) Outputs[i] = otherCoin.Outputs[i]; } UpdateValue(); }
public TxOut GetOutputFor(TxIn input) { Coins coins = GetCoins(input.PrevOut.Hash); return(coins.TryGetOutput(input.PrevOut.N)); }
public void SetCoins(uint256 txId, Coins coins) { this.NoSqlRepository.PutAsync(txId.ToString(), coins); }