Ejemplo n.º 1
0
        public byte[] ComputeSigHash(Transaction transaction, TransactionInput input, TransactionOutput priorOutput, SigHashType sigHashType)
        {
            if (sigHashType != SigHashType.All)
            {
                throw new NotImplementedException("Only supports SigHashType.All");
            }

            var hashingScript = IsPayToScriptHash(input.SigScript, priorOutput.ScriptPubKey) ?
                                DecodeRedeemScript((byte[])input.SigScript.Commands[^ 1]) :
Ejemplo n.º 2
0
 void Write(TransactionOutput output)
 {
     Write(output.Amount, 8);
     Write(output.ScriptPubKey);
 }
Ejemplo n.º 3
0
        public Transaction CloneWithReplacedOutput(TransactionOutput oldOutput, TransactionOutput newOutput)
        {
            var newOutputs = Outputs.Select(o => o == oldOutput ? newOutput : o);

            return(new(Version, Segwit, Inputs, newOutputs, LockTime, Testnet));
        }