// Assume a utxo object like the following
const utxo = { txid, vout, satoshis, script }
tx = new nimble.Transaction()
tx.from(utxo).change(address).sign(privkey)
Broadcasting the above results in network error:
16: mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation)]
I think there is an issue with the incorrect value being on the output, which would mean the preimage is wrong. eg, sign() should probably call this._calculateChange() before it generates the preimage and sig. But even when we do that the above error persists which suggests something else is afoot.
Broadcasting the above results in network error:
I think there is an issue with the incorrect value being on the output, which would mean the preimage is wrong. eg,
sign()should probably callthis._calculateChange()before it generates the preimage and sig. But even when we do that the above error persists which suggests something else is afoot.