Correctly set vout for getrawtransaction.

The vout field (as part of the getrawtransaction JSON reply) should be
set to the input's previous outpoint's index, not the current input
index.

Found by flam and reported on IRC. Thanks!
This commit is contained in:
Josh Rickmar 2013-12-06 17:34:18 -05:00
parent bbb10dc387
commit 305be0c29f

View file

@ -887,7 +887,7 @@ func handleGetRawTransaction(s *rpcServer, cmd btcjson.Cmd, walletNotification c
vinList[i].Sequence = float64(v.Sequence)
disbuf, _ := btcscript.DisasmString(v.SignatureScript)
vinList[i].ScriptSig.Asm = strings.Replace(disbuf, " ", "", -1)
vinList[i].Vout = i + 1
vinList[i].Vout = int(v.PreviousOutpoint.Index)
rpcsLog.Debugf(disbuf)
}