0
Suppose I'm writing a transaction by hand, that spends an existing uspent output sent by myself from another address. Is there a way to test if the transaction can really spend that output, before brodcasting? The reason is, I want to be sure if I'm correctly generating the sigScript.
EDIT: I know it is possible to syntactically verify transactions, but I'm asking if do exists a method such as canSpend(myTransaction, unspentOutput). Ideally that would execute the combination of scripts myTransaction.sigScript and unspentOutput.ScriptPubKey and check if the result is true.
does it test also if sigScript + ScriptPubKey return true, so if the transaction really can spend that input? – robermann – 2018-09-04T07:50:45.453
It should, yes. A bad script will not be accepted into the mempool – Raghav Sood – 2018-09-04T08:02:52.467