private Connect ( Transaction>.IDictionary |
||
transactions | Transaction>.IDictionary | Map of txhash->transaction. |
disconnect | bool | Whether to abort if there's a pre-existing connection or not. |
return | ConnectionResult |
internal ConnectionResult Connect(IDictionary<Sha256Hash, Transaction> transactions, bool disconnect)
{
Transaction tx;
if (!transactions.TryGetValue(Outpoint.Hash, out tx))
return ConnectionResult.NoSuchTx;
var @out = tx.Outputs[Outpoint.Index];
if ([email protected])
{
if (disconnect)
@out.MarkAsUnspent();
else
return ConnectionResult.AlreadySpent;
}
Outpoint.FromTx = tx;
@out.MarkAsSpent(this);
return ConnectionResult.Success;
}