]> Git Repo - VerusCoin.git/commitdiff
test
authorjl777 <[email protected]>
Thu, 1 Dec 2016 14:27:22 +0000 (11:27 -0300)
committerjl777 <[email protected]>
Thu, 1 Dec 2016 14:27:22 +0000 (11:27 -0300)
src/rpcblockchain.cpp

index 8d9eeda2d2f3ea707a8d084ced39cba71946395b..610267a451b6513fbffe1b9d84e5c2c31f53f960 100644 (file)
@@ -700,7 +700,7 @@ int32_t gettxout_scriptPubKey(uint8_t *scriptPubKey,int32_t maxsize,uint256 txid
             //fprintf(stderr,"cant get pcoinsTip->GetCoins\n");
             continue;
         }
-        if ( n < 0 || (unsigned int)n >= coins.vout.size() || coins.vout[n].IsNull() )
+        if ( n < 0 || (unsigned int)n > coins.vout.size() || coins.vout[n].IsNull() ) // vout.size() seems off by 1
         {
             fprintf(stderr,"iter.%d n.%d vs voutsize.%d\n",iter,n,(int32_t)coins.vout.size());
             continue;
@@ -715,7 +715,7 @@ int32_t gettxout_scriptPubKey(uint8_t *scriptPubKey,int32_t maxsize,uint256 txid
     uint256 hashBlock;
     if ( GetTransaction(txid,tx,hashBlock,true) == 0 )
         return(-1);
-    else //if ( n < tx.vout.size() )
+    else if ( n <= tx.vout.size() ) // vout.size() seems off by 1
     {
         ptr = (uint8_t *)tx.vout[n].scriptPubKey.data();
         m = tx.vout[n].scriptPubKey.size();
This page took 0.029156 seconds and 4 git commands to generate.