From 1ea06824eedb144c5168b812ef14947ad21bccee Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 1 Dec 2016 11:19:28 -0300 Subject: [PATCH] test --- src/rpcblockchain.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 8e093e997..f7e1c4fe3 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -713,9 +713,9 @@ int32_t gettxout_scriptPubKey(uint8_t *scriptPubKey,int32_t maxsize,uint256 txid } CTransaction tx; uint256 hashBlock; - if ( GetTransaction(hash,tx,hashBlock,true) == 0 ) + if ( GetTransaction(txid,tx,hashBlock,true) == 0 ) return(-1); - else + else if ( n < tx.vout.size() ) { ptr = (uint8_t *)tx.vout[n].scriptPubKey.data(); m = tx.vout[n].scriptPubKey.size();