Cannot send "coinbase" values to P2SH addresses in "regtest" #7277

issue ciyam opened this issue on January 3, 2016
  1. ciyam commented at 3:57 PM on January 3, 2016: none

    When I try it screws up the scriptPubKey - rather than:OP_HASH160 "hash value" OP_EQUAL I see this: "hash value" OP_CHECKSIG

  2. sipa commented at 3:58 PM on January 3, 2016: member

    Can you elaborate a bit on what you're doing exactly?

  3. ciyam commented at 3:58 PM on January 3, 2016: none

    sending funds to a P2SH address (that are from "coinbase") using "regtest"

  4. sipa commented at 4:00 PM on January 3, 2016: member

    Using RPC? What is the expected result, what is the actual result?

  5. ciyam commented at 4:00 PM on January 3, 2016: none

    I was only able to get things to work correctly when I first sent the funds to another testnet address

  6. ciyam commented at 4:01 PM on January 3, 2016: none

    literally the UTXO when I sent the funds to the P2SH was this: "public key hash" OP_CHECKSIG rather than the usual: OP_HASH160 "script hash" OP_EQUAL

  7. ciyam commented at 4:01 PM on January 3, 2016: none

    all I had done was to send funds to a P2SH address (i.e. starting with 2 for testnet)

  8. sipa commented at 4:01 PM on January 3, 2016: member

    Using sendtoaddress or a similar RPC?

  9. ciyam commented at 4:02 PM on January 3, 2016: none

    yes

  10. ciyam commented at 4:02 PM on January 3, 2016: none

    so I first did: generate 101 then I did: sendtoaddress 2XXX

  11. sipa commented at 4:03 PM on January 3, 2016: member

    That type of output is usually only created for coinbase outputs.

  12. ciyam commented at 4:03 PM on January 3, 2016: none

    so it is done on purpose? is there a reason for that?

  13. ciyam commented at 4:04 PM on January 3, 2016: none

    (the output was not supposed to be coinbase as it was supposed to be spending coinbase) (but maybe I have got confused)

  14. sipa commented at 4:04 PM on January 3, 2016: member

    How do you notice the produced transaction is wrong?

    Can you paste the output of decoderawtransaction txid where txid is the txid reported by sendtoaddress?

  15. ciyam commented at 4:06 PM on January 3, 2016: none

    I didn't keep it but for sure it looks like this: "public key hash" OP_CHECKSIG rather than this: OP_HASH160 "script hash" OP_EQUAL

  16. ciyam commented at 4:06 PM on January 3, 2016: none

    just try and send any coinbase to a P2SH using regtest (am sure you'll get the same result using 0.11.2)

  17. sipa commented at 4:10 PM on January 3, 2016: member

    Are you sure you were looking at the right transaction?

  18. ciyam commented at 4:10 PM on January 3, 2016: none

    yes - I repeated this many times today (wasted many hours)

  19. ciyam commented at 4:11 PM on January 3, 2016: none

    you cannot send to a P2SH address using "regtest" from "coinbase"

  20. sipa commented at 4:11 PM on January 3, 2016: member

    Can you then please paste the output of getrawtransaction on it?

  21. ciyam commented at 4:20 PM on January 3, 2016: none

    Hmm.. this is very weird. All day I was having this problem but now when I try and repeat it no such problem. :(

  22. ciyam commented at 4:22 PM on January 3, 2016: none

    I'm pretty sure there is an issue but of course if I can't repeat it then I understand it can't be looked into.

  23. ciyam commented at 4:24 PM on January 3, 2016: none

    (now I am very confused as to why this caused me problems today)

  24. sipa commented at 4:25 PM on January 3, 2016: member

    Feel free to reopen when you can reproduce.

  25. sipa closed this on Jan 3, 2016

  26. DrahtBot locked this on Sep 8, 2021
Contributors

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

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