Fixes #2480. Null entry in map was dereferenced leading to a segfault.
This commit is contained in:
@@ -589,6 +589,10 @@ bool AsyncRPCOperation_sendmany::main_impl() {
|
|||||||
{
|
{
|
||||||
LOCK2(cs_main, pwalletMain->cs_wallet);
|
LOCK2(cs_main, pwalletMain->cs_wallet);
|
||||||
const CWalletTx& wtx = pwalletMain->mapWallet[jso.hash];
|
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;
|
wtxHeight = mapBlockIndex[wtx.hashBlock]->nHeight;
|
||||||
wtxDepth = wtx.GetDepthInMainChain();
|
wtxDepth = wtx.GetDepthInMainChain();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user