]> Git Repo - VerusCoin.git/commitdiff
Fixes #2480. Null entry in map was dereferenced leading to a segfault.
authorSimon <[email protected]>
Wed, 12 Jul 2017 01:03:10 +0000 (18:03 -0700)
committerSimon <[email protected]>
Fri, 14 Jul 2017 07:10:54 +0000 (00:10 -0700)
src/wallet/asyncrpcoperation_sendmany.cpp

index ac4490197340fdd68abf8818d75464da91f7909b..901bd9e341711ac48c98aa015f8fa01074d0b57a 100644 (file)
@@ -589,6 +589,10 @@ bool AsyncRPCOperation_sendmany::main_impl() {
             {
                 LOCK2(cs_main, pwalletMain->cs_wallet);
                 const CWalletTx& wtx = pwalletMain->mapWallet[jso.hash];
+                // Zero confirmaton notes belong to transactions which have not yet been mined
+                if (mapBlockIndex.find(wtx.hashBlock) == mapBlockIndex.end()) {
+                    throw JSONRPCError(RPC_WALLET_ERROR, strprintf("mapBlockIndex does not contain block hash %s", wtx.hashBlock.ToString()));
+                }
                 wtxHeight = mapBlockIndex[wtx.hashBlock]->nHeight;
                 wtxDepth = wtx.GetDepthInMainChain();
             }
This page took 0.025374 seconds and 4 git commands to generate.