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