Esempio 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]) :
Esempio n. 2
0
 void Write(TransactionOutput output)
 {
     Write(output.Amount, 8);
     Write(output.ScriptPubKey);
 }
Esempio 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));
        }