Skip to content

Commit

Permalink
return null when tx not in mempool
Browse files Browse the repository at this point in the history
  • Loading branch information
ogabrielides committed Nov 28, 2023
1 parent 6c57cc2 commit a56f808
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/rpc/rawtransaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,13 @@ static UniValue gettxchainlocks(const JSONRPCRequest& request)
int height{-1};
bool chainLock{false};

GetTransaction(nullptr, nullptr, txid, Params().GetConsensus(), hash_block);
auto tx_ref = GetTransaction(nullptr, node.mempool.get(), txid, Params().GetConsensus(), hash_block);

if (tx_ref == nullptr) {
UniValue r(UniValue::VNULL);
result_arr.push_back(r);
continue;
}

if (!hash_block.IsNull()) {
LOCK(cs_main);
Expand Down

0 comments on commit a56f808

Please sign in to comment.