From eb2c570489ba2aef5b3d4a88afd2a94e66321e3a Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Sun, 7 Oct 2018 21:51:52 +0200 Subject: [PATCH] Fix coredump on txindex=0 nodes --- src/komodo_validation011.h | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/komodo_validation011.h b/src/komodo_validation011.h index d640331af..e1aa8cd3a 100644 --- a/src/komodo_validation011.h +++ b/src/komodo_validation011.h @@ -96,16 +96,10 @@ int32_t gettxout_scriptPubKey(int32_t height,uint8_t *scriptPubKey,int32_t maxsi } else { - CWallet * const pwallet = vpwallets[0]; - if ( pwallet != 0 ) + if ( GetTransaction(txid,tx,hashBlock,true) == 0 ) { - auto it = pwallet->mapWallet.find(txid); - if ( it != pwallet->mapWallet.end() ) - { - const CWalletTx& wtx = it->second; - tx = *wtx.tx; - fprintf(stderr,"found tx in wallet\n"); - } + fprintf(stderr,"ht.%d couldnt get txid.%s !\n",height,txid.GetHex().c_str()); + return(-1); } } @@ -1223,9 +1217,9 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block) } } } else if ( block.vtx[i].vin[j].prevout.hash != zero ) { - fprintf(stderr,"%s cant get scriptPubKey for ht.%d txi.%d vin.%d\n",ASSETCHAINS_SYMBOL,height,i,j); + //if (IS_NOTARY) + // fprintf(stderr,"%s cant get scriptPubKey for ht.%d txi.%d vin.%d\n",ASSETCHAINS_SYMBOL,height,i,j); } - } numvalid = bitweight(signedmask); if ( numvalid >= KOMODO_MINRATIFY )