signrawtransaction incorrectly reports "complete" as false when the transaction is completely signed #5960

issue davout opened this issue on April 2, 2015
  1. davout commented at 10:10 AM on April 2, 2015: none

    I took a random transaction in a random block. When attempting to sign an already signed transaction it should report the "complete" field as "true", in this example it reports false.

    Results of a getinfo (txindex is enabled)

    {
        "version" : 109900,
        "protocolversion" : 70002,
        "walletversion" : 60000,
        "balance" : 47.88578288,
        "blocks" : 350358,
        "timeoffset" : -1,
        "connections" : 8,
        "proxy" : "",
        "difficulty" : 46717549644.70642090,
        "testnet" : false,
        "keypoololdest" : 1400773375,
        "keypoolsize" : 101,
        "unlocked_until" : 1427969640,
        "paytxfee" : 0.00000000,
        "relayfee" : 0.00001000,
        "errors" : "This is a pre-release test build - use at your own risk - do not use for mining or merchant applications"
    }
    

    Reproduction:

    $ bitcoin getrawtransaction be273ceb7449ec7c906ce6ee2cf9e8aab15b025235526a5e61cfd3cbabc628ed
    010000000348c568ba5a38f8d4867a047899763e4e3479b7b0c5cb4b3b781ebe2a1524429a010000006b48304502203892627e4f41925f111fe05d5799b116fb79e5657aff73f6ba36b9b0cce9cc56022100bfaf394005235eb1c4a7386a0eb67638f4f160db4ce34c2f8e2fcc2e11f37cd10121027f1afcc9f4844e790e79ffeb759121f835feaf2d23759fce29adfcadf3215333ffffffff37e031c49696f1d12280ae08a88395976def344f109052e8aea2c496195eb173010000006b483045022100e165809b9d8947b2bac0e8a50de626fd1ab6c1b89feaee00c9d62c327df35c58022061f1e846027b4a097d5297044c086780c2360bb0328106fe3d7d4f815558b1b00121027f1afcc9f4844e790e79ffeb759121f835feaf2d23759fce29adfcadf3215333ffffffff72d305a1af7862d36ce6aad87ec2ab3825e46ef3eec52b0c63260bd1de376019000000006b48304502200eda9f0b6f5d50d26f77b927a30f95b2191c6dda118b294402ab828c4d5993cb02210080df452f3c7feeecab4ea4442e8bdab4dff91f4e879d617ec4e2925833733935012103a37f8496463f5fce71e1f0a213a3da02b1a76d58f651f993d2e17c60524f5455ffffffff0260c93456000000001976a9146db120368f5357adfdfddf2e1f4fdef85e6c947888ac75b80000000000001976a9142c17d7ad8105213a8743583073f1877ea098e66688ac00000000
    
    $ bitcoin signrawtransaction 010000000348c568ba5a38f8d4867a047899763e4e3479b7b0c5cb4b3b781ebe2a1524429a010000006b48304502203892627e4f41925f111fe05d5799b116fb79e5657aff73f6ba36b9b0cce9cc56022100bfaf394005235eb1c4a7386a0eb67638f4f160db4ce34c2f8e2fcc2e11f37cd10121027f1afcc9f4844e790e79ffeb759121f835feaf2d23759fce29adfcadf3215333ffffffff37e031c49696f1d12280ae08a88395976def344f109052e8aea2c496195eb173010000006b483045022100e165809b9d8947b2bac0e8a50de626fd1ab6c1b89feaee00c9d62c327df35c58022061f1e846027b4a097d5297044c086780c2360bb0328106fe3d7d4f815558b1b00121027f1afcc9f4844e790e79ffeb759121f835feaf2d23759fce29adfcadf3215333ffffffff72d305a1af7862d36ce6aad87ec2ab3825e46ef3eec52b0c63260bd1de376019000000006b48304502200eda9f0b6f5d50d26f77b927a30f95b2191c6dda118b294402ab828c4d5993cb02210080df452f3c7feeecab4ea4442e8bdab4dff91f4e879d617ec4e2925833733935012103a37f8496463f5fce71e1f0a213a3da02b1a76d58f651f993d2e17c60524f5455ffffffff0260c93456000000001976a9146db120368f5357adfdfddf2e1f4fdef85e6c947888ac75b80000000000001976a9142c17d7ad8105213a8743583073f1877ea098e66688ac00000000
    {
        "hex" : "010000000348c568ba5a38f8d4867a047899763e4e3479b7b0c5cb4b3b781ebe2a1524429a010000006b48304502203892627e4f41925f111fe05d5799b116fb79e5657aff73f6ba36b9b0cce9cc56022100bfaf394005235eb1c4a7386a0eb67638f4f160db4ce34c2f8e2fcc2e11f37cd10121027f1afcc9f4844e790e79ffeb759121f835feaf2d23759fce29adfcadf3215333ffffffff37e031c49696f1d12280ae08a88395976def344f109052e8aea2c496195eb173010000006b483045022100e165809b9d8947b2bac0e8a50de626fd1ab6c1b89feaee00c9d62c327df35c58022061f1e846027b4a097d5297044c086780c2360bb0328106fe3d7d4f815558b1b00121027f1afcc9f4844e790e79ffeb759121f835feaf2d23759fce29adfcadf3215333ffffffff72d305a1af7862d36ce6aad87ec2ab3825e46ef3eec52b0c63260bd1de376019000000006b48304502200eda9f0b6f5d50d26f77b927a30f95b2191c6dda118b294402ab828c4d5993cb02210080df452f3c7feeecab4ea4442e8bdab4dff91f4e879d617ec4e2925833733935012103a37f8496463f5fce71e1f0a213a3da02b1a76d58f651f993d2e17c60524f5455ffffffff0260c93456000000001976a9146db120368f5357adfdfddf2e1f4fdef85e6c947888ac75b80000000000001976a9142c17d7ad8105213a8743583073f1877ea098e66688ac00000000",
        "complete" : false
    }
    
  2. sipa commented at 9:22 PM on April 2, 2015: member

    signrawtransaction uses the standard script verification flags to test the signatures, which are stricter than the consensus rules, and certainly stricter than what the consensus rules were in the past.

  3. davout commented at 10:48 AM on April 15, 2015: none

    @sipa I'm slightly confused by your answer, isn't a transaction being signed purely binary depending on whether the transaction bears a valid signature or not?

    If the transaction is checked with isStandard(), wouldn't that mandate second flag, to get an output like

    {
        "hex" : "010000000348c568ba5a38f8d4867a047899763e4e3479b7b0c5cb4b3b781ebe2a1524429a010000006b48304502203892627e4f41925f111fe05d5799b116fb79e5657aff73f6ba36b9b0cce9cc56022100bfaf394005235eb1c4a7386a0eb67638f4f160db4ce34c2f8e2fcc2e11f37cd10121027f1afcc9f4844e790e79ffeb759121f835feaf2d23759fce29adfcadf3215333ffffffff37e031c49696f1d12280ae08a88395976def344f109052e8aea2c496195eb173010000006b483045022100e165809b9d8947b2bac0e8a50de626fd1ab6c1b89feaee00c9d62c327df35c58022061f1e846027b4a097d5297044c086780c2360bb0328106fe3d7d4f815558b1b00121027f1afcc9f4844e790e79ffeb759121f835feaf2d23759fce29adfcadf3215333ffffffff72d305a1af7862d36ce6aad87ec2ab3825e46ef3eec52b0c63260bd1de376019000000006b48304502200eda9f0b6f5d50d26f77b927a30f95b2191c6dda118b294402ab828c4d5993cb02210080df452f3c7feeecab4ea4442e8bdab4dff91f4e879d617ec4e2925833733935012103a37f8496463f5fce71e1f0a213a3da02b1a76d58f651f993d2e17c60524f5455ffffffff0260c93456000000001976a9146db120368f5357adfdfddf2e1f4fdef85e6c947888ac75b80000000000001976a9142c17d7ad8105213a8743583073f1877ea098e66688ac00000000",
        "complete" : true,
        "standard": false
    }
    
  4. sipa commented at 10:57 AM on April 15, 2015: member

    It's a bit more complicated than that. Script validation has several flags, some are controlled by softforks, some by policy. It's not exactly IsStandard(), but similar.

  5. sipa commented at 10:59 AM on April 15, 2015: member

    We should probably reduce the flags used to check script completeness to just the mandatory flags.

  6. laanwj added the label RPC on May 18, 2015
  7. pinheadmz commented at 2:19 PM on April 27, 2023: member

    This is no longer an issue in recent versions of Bitcoin Core. We'll close it for now, please feel free to add additional comments or open a new issue if you think that would be helpful.

    Deprecated by PSBT

  8. pinheadmz closed this on Apr 27, 2023

  9. bitcoin locked this on Apr 26, 2024

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-13 15:15 UTC

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