Signrawtransactionwithwallet when using segwit and previous transactions provided #19814

issue liorko87 opened this issue on August 26, 2020
  1. liorko87 commented at 3:55 PM on August 26, 2020: none

    <!-- This issue tracker is only for technical issues related to Bitcoin Core. General bitcoin questions and/or support requests are best directed to the Bitcoin StackExchange at https://bitcoin.stackexchange.com. For reporting security issues, please read instructions at https://bitcoincore.org/en/contact/. If the node is "stuck" during sync or giving "block checksum mismatch" errors, please ensure your hardware is stable by running memtest and observe CPU temperature with a load-test tool such as linpack before creating an issue! -->

    <!-- Describe the issue -->

    Expected behavior The transaction will be sent to the other node.

    <!--- What behavior did you expect? -->

    Actual behavior When calling sendrawtransaction, the provided output is:

    error code: -26
    error message:
    non-mandatory-script-verify-flag (Signature must be zero for failed CHECK(MULTI)SIG operation)
    

    <!--- What was the actual behavior (provide screenshots if the issue is GUI-related)? -->

    To reproduce

    ./bitcoin-cli --datadir=/home/user/bitcoinNodes/node2 signrawtransactionwithwallet \
    02000000018a0cd4d224a023fd8ee2cbc43451fb01a853c55ec009b34145c464da1e0c4b5a0000000000ffffffff02e00f9700000000001600140845db2986a7dba1f41bc3fac2617965da9d70e90000000000000000136a1149204b4e4f5720424c4f434b434841494e00000000 \
    '[{"txid": "5a4b0c1eda64c44541b309c05ec553a801fb5134c4cbe28efd23a024d2d40c8a", "vout":0, "scriptPubKey": "00141b35076bfdb3e38c99dce3f73895009bd650191e", "amount":0.099}]'
    

    <!--- How reliably can you reproduce the issue, what are the steps to do so? -->

    System information OS: Ubuntu 20.04.1 LTS Bitcoin version: 0.20

    <!-- What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)? -->

    <!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->

    <!-- GUI-related issue? What is your operating system and its version? If Linux, what is your desktop environment and graphical shell? -->

    <!-- Any extra information that might be useful in the debugging process. -->

    <!--- This is normally the contents of a `debug.log` or `config.log` file. Raw text or a link to a pastebin type site are preferred. -->

  2. liorko87 added the label Bug on Aug 26, 2020
  3. ghost commented at 5:36 AM on August 28, 2020: none

    What happens if you don't mention the optional second argument and only mention serialized hex with 'signrawtransactionwithwallet' ?

  4. liorko87 commented at 6:44 AM on August 30, 2020: none

    The same is happening when I'm don't mention the second argument. Anyway, I solved it- the error relate to the amount of the transaction. I inserted the amount of the output transaction and not the input transaction.
    After I changed it the error disappeared. A clearer error message will help to debug this problem in the future.

  5. adamjonas commented at 8:00 PM on August 3, 2022: member

    Closing given the issue was filed based on switching the output and input transaction amount. Noting that a better error message would be helpful but closing for now.

  6. adamjonas closed this on Aug 3, 2022

  7. bitcoin locked this on Aug 3, 2023
Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-25 18:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me