Skip to content

Invalid tx when spending only to change output #14

@libitx

Description

@libitx
// 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions