hashtype is not flag based despite having a flag embedded.
So (SigHashAll & SigHashSingle)!= 0, which is not the intention here. fix up that check to only match SigHashSingle. Found by drahn, debugged together, fix by me.
This commit is contained in:
parent
c53ada2f71
commit
2c4ea4e4bc
1 changed files with 2 additions and 2 deletions
|
@ -2014,8 +2014,8 @@ func SignRawTransaction(icmd btcjson.Cmd) (interface{}, *btcjson.Error) {
|
|||
// SigHashSingle inputs can only be signed if there's a
|
||||
// corresponding output. However this could be already signed,
|
||||
// so we always verify the output.
|
||||
if (hashType&btcscript.SigHashSingle) == 0 ||
|
||||
i < len(msgTx.TxOut) {
|
||||
if (hashType&btcscript.SigHashSingle) !=
|
||||
btcscript.SigHashSingle || i < len(msgTx.TxOut) {
|
||||
|
||||
script, err := btcscript.SignTxOutput(activeNet.Net,
|
||||
msgTx, i, input, byte(hashType), getKey,
|
||||
|
|
Loading…
Reference in a new issue