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.