Skip to content

Commit e323449

Browse files
Merge #7740: fix: various fixes and improvements for v24 release
07ab48f fix(qt): don't credit OP_RETURN outputs to the wallet in received txs (Konstantin Akimov) 515ab08 fix(net): make better bounding for the oversized NOTFOUND (Konstantin Akimov) f891d06 test: run feature_llmq_chainlocks with -spentindex (Konstantin Akimov) cb876e4 fix: don't hold cs_main across TxToJSON in getspecialtxes (Konstantin Akimov) Pull request description: ## Issue being fixed or feature implemented See each commit. ## What was done? - fix: don't hold cs_main across TxToJSON in getspecialtxes - test: run feature_llmq_chainlocks with -spentindex - fix(net): make better bounding for the oversized NOTFOUND - fix(qt): don't credit OP_RETURN outputs to the wallet in received txs ## How Has This Been Tested? Run unit & functional tests ## Breaking Changes N/A ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ Top commit has no ACKs. Tree-SHA512: 86c1eceee731da934d166722721797b111f80707992c47b40befababd01993d9c0eac48452acf7b25da561fe820250dcc49acd6a01e8f5d3806ab9499d34ed35
2 parents de0605c + 07ab48f commit e323449

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

‎src/net_processing.cpp‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5743,9 +5743,11 @@ void PeerManagerImpl::ProcessMessage(
57435743
// Remove the NOTFOUND objects from the peer
57445744
std::vector<CInv> vInv;
57455745
vRecv >> vInv;
5746-
// A malicious peer can send a NOTFOUND entry per tracked announcement, so bound the
5747-
// message size by the announcement cap rather than the (soft) in-flight limit.
5748-
if (vInv.size() > MAX_PEER_OBJECT_ANNOUNCEMENTS + MAX_BLOCKS_IN_TRANSIT_PER_PEER) {
5746+
// A malicious peer can send a NOTFOUND entry per tracked announcement, and every
5747+
// entry costs a tracker lookup under m_object_request_mutex, so bound the message
5748+
// by the announcement cap. That cap alone exceeds what a message can carry, so
5749+
// clamp it to MAX_INV_SZ, the bound INV and GETDATA already use.
5750+
if (vInv.size() > std::min<size_t>(MAX_INV_SZ, MAX_PEER_OBJECT_ANNOUNCEMENTS + MAX_BLOCKS_IN_TRANSIT_PER_PEER)) {
57495751
Misbehaving(*peer, 20, strprintf("notfound message size = %u", vInv.size()));
57505752
return;
57515753
}

‎src/qt/transactionrecord.cpp‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(interfaces::Nod
137137
else if (!wtx.is_coinbase && !is_asset_lock && IsDataScript(txout.scriptPubKey))
138138
{
139139
TransactionRecord sub(hash, nTime);
140-
sub.credit = txout.nValue;
141140
sub.idx = i;
142141
sub.involvesWatchAddress = false;
143142
sub.strAddress = "";

‎src/rpc/blockchain.cpp‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2485,7 +2485,6 @@ static RPCHelpMan getspecialtxes()
24852485
const NodeContext& node = EnsureAnyNodeContext(request.context);
24862486

24872487
ChainstateManager& chainman = EnsureChainman(node);
2488-
LOCK(cs_main);
24892488

24902489
const CTxMemPool& mempool = EnsureMemPool(node);
24912490
const llmq::CInstantSendManager& isman = EnsureInstantSendManager(node);
@@ -2520,7 +2519,7 @@ static RPCHelpMan getspecialtxes()
25202519
}
25212520
}
25222521

2523-
const CBlockIndex* pblockindex = chainman.m_blockman.LookupBlockIndex(blockhash);
2522+
const CBlockIndex* pblockindex = WITH_LOCK(cs_main, return chainman.m_blockman.LookupBlockIndex(blockhash));
25242523
if (!pblockindex) {
25252524
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found");
25262525
}

‎test/functional/feature_llmq_chainlocks.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def add_options(self, parser):
2323
self.add_wallet_options(parser)
2424

2525
def set_test_params(self):
26-
self.set_dash_test_params(5, 4)
26+
self.set_dash_test_params(5, 4, [["-spentindex"]] * 5)
2727
self.delay_v20_and_mn_rr(height=200)
2828

2929
def sleep_and_assert_no_cl(self, block_hash, sleep_time=5):

0 commit comments

Comments
 (0)