sipa / bitcoin

Bitcoin integration/staging tree
http://www.bitcoin.org
MIT License
88 stars 21 forks source link

signrawtransaction can sign P2WSH #69

Closed NicolasDorier closed 8 years ago

NicolasDorier commented 8 years ago

@sdaftuar might be useful for your tests

fivepiece commented 8 years ago

`bitcoin-cli -segnet signrawtransaction 010000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff01e8030000000000001976a9144c9c3dfac4207d5d8cb89df5722cb3d712385e3f88ac00000000 '[{"txid":"0000000000000000000000000000000000000000000000000000000000000100","vout":0,"scriptPubKey":"0020ff25429251b5a84f452230a3c75fd886b7fc5a7865ce4a7bb7a9d7c5be6da3db","redeemScript":"2103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc71ac","amount":0.00001000}]' '["QWZL3KqGUNZ5WQGgw5b6ui14VGv7NAbZvroCjUB8ucVVnZZ5T1uZ"]'``

works now, though the same using bitcoin-tx still doesn't

fivepiece commented 8 years ago

Replacing ./src/bitcoin-tx.cpp:448 to:

if (fGivenKeys && ( scriptPubKey.IsPayToScriptHash() || scriptPubKey.IsPayToWitnessScriptHash() ) &&

Makes it work!

NicolasDorier commented 8 years ago

awesome thanks a lot for you testing, I updated the PR

sipa commented 8 years ago

Cherry-picked into segwit4.