From 305be0c29faac75763603428b8f337f7c916a865 Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Fri, 6 Dec 2013 17:34:18 -0500 Subject: [PATCH] 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! --- rpcserver.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpcserver.go b/rpcserver.go index fbe80958..5c30f5c8 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -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) }