Skip to content

Commit 80ed279

Browse files
Merge #6328: backport: bitcoin#30131, bitcoin#23258, bitcoin#30504 - fix bild for Ubuntu 24.10 + clang
e994691 Merge bitcoin#30504: doc: use proper doxygen formatting for CTxMemPool::cs (merge-script) a3e6378 Merge bitcoin#23258: doc: Fix outdated comments referring to ::ChainActive() (fanquake) dcbf671 Merge bitcoin#30131: wallet, tests: Avoid stringop-overflow warning in PollutePubKey (merge-script) Pull request description: ## Issue being fixed or feature implemented It fixes build with clang 19.1.1 (default clang version on Ubuntu 24.10) ## What was done? Backport 30131, 30504 to fix compilation error and warning; 23258 to reduce conflicts. See commit messages for details ## How Has This Been Tested? Build and succeed ``` CC=clang CXX=clang++ ./configure --prefix=$(pwd)/depends/x86_64-pc-linux-gnu --enable-suppress-external-warnings --enable-debug --enable-stacktraces --enable-werror --enable-crash-hooks --enable-maintainer-mode --enable-multiprocess ``` ## Breaking Changes N/A ## Checklist: - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have added or updated relevant unit/integration/functional/e2e tests - [x] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone ACKs for top commit: PastaPastaPasta: utACK e994691 UdjinM6: utACK e994691 Tree-SHA512: 82623030c164c0852d87e8497a59157630f87a385050b6c58d79bf5a8f32462fb26cb02e61b1062afdf9f835e10b9baf4590c326c0fb41bbdd79c82e9d105513
1 parent bd772fb commit 80ed279

File tree

6 files changed

+9
-10
lines changed

6 files changed

+9
-10
lines changed

src/index/base.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ bool BaseIndex::BlockUntilSyncedToCurrentChain() const
328328

329329
{
330330
// Skip the queue-draining stuff if we know we're caught up with
331-
// ::ChainActive().Tip().
331+
// m_chain.Tip().
332332
LOCK(cs_main);
333333
const CBlockIndex* chain_tip = m_chainstate->m_chain.Tip();
334334
const CBlockIndex* best_block_index = m_best_block_index.load();

src/policy/fees.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ void CBlockPolicyEstimator::processTransaction(const CTxMemPoolEntry& entry, boo
554554
if (txHeight != nBestSeenHeight) {
555555
// Ignore side chains and re-orgs; assuming they are random they don't
556556
// affect the estimate. We'll potentially double count transactions in 1-block reorgs.
557-
// Ignore txs if BlockPolicyEstimator is not in sync with ::ChainActive().Tip().
557+
// Ignore txs if BlockPolicyEstimator is not in sync with ActiveChain().Tip().
558558
// It will be synced next time a block is processed.
559559
return;
560560
}

src/txmempool.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -524,17 +524,14 @@ class CTxMemPool
524524
* that are guarded by it.
525525
*
526526
* @par Consistency guarantees
527-
*
528527
* By design, it is guaranteed that:
529-
*
530528
* 1. Locking both `cs_main` and `mempool.cs` will give a view of mempool
531-
* that is consistent with current chain tip (`::ChainActive()` and
529+
* that is consistent with current chain tip (`ActiveChain()` and
532530
* `CoinsTip()`) and is fully populated. Fully populated means that if the
533531
* current active chain is missing transactions that were present in a
534532
* previously active chain, all the missing transactions will have been
535533
* re-added to the mempool and should be present if they meet size and
536534
* consistency constraints.
537-
*
538535
* 2. Locking `mempool.cs` without `cs_main` will give a view of a mempool
539536
* consistent with some chain that was active since `cs_main` was last
540537
* locked, and that is fully populated as described above. It is ok for

src/validation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ static const bool DEFAULT_SYNC_MEMPOOL = true;
104104

105105
/** Default for -stopatheight */
106106
static const int DEFAULT_STOPATHEIGHT = 0;
107-
/** Block files containing a block-height within MIN_BLOCKS_TO_KEEP of ::ChainActive().Tip() will not be pruned. */
107+
/** Block files containing a block-height within MIN_BLOCKS_TO_KEEP of ActiveChain().Tip() will not be pruned. */
108108
static const unsigned int MIN_BLOCKS_TO_KEEP = 288;
109109
static const signed int DEFAULT_CHECKBLOCKS = 6;
110110
static const unsigned int DEFAULT_CHECKLEVEL = 3;

src/wallet/test/wallet_tests.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,8 +526,10 @@ static void TestWatchOnlyPubKey(LegacyScriptPubKeyMan* spk_man, const CPubKey& a
526526
// Cryptographically invalidate a PubKey whilst keeping length and first byte
527527
static void PollutePubKey(CPubKey& pubkey)
528528
{
529-
std::vector<unsigned char> pubkey_raw(pubkey.begin(), pubkey.end());
530-
std::fill(pubkey_raw.begin()+1, pubkey_raw.end(), 0);
529+
assert(pubkey.size() >= 1);
530+
std::vector<unsigned char> pubkey_raw;
531+
pubkey_raw.push_back(pubkey[0]);
532+
pubkey_raw.insert(pubkey_raw.end(), pubkey.size() - 1, 0);
531533
pubkey = CPubKey(pubkey_raw);
532534
assert(!pubkey.IsFullyValid());
533535
assert(pubkey.IsValid());

src/wallet/wallet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1313,7 +1313,7 @@ void CWallet::updatedBlockTip()
13131313
void CWallet::BlockUntilSyncedToCurrentChain() const {
13141314
AssertLockNotHeld(cs_wallet);
13151315
// Skip the queue-draining stuff if we know we're caught up with
1316-
// chainActive.Tip(), otherwise put a callback in the validation interface queue and wait
1316+
// chain().Tip(), otherwise put a callback in the validation interface queue and wait
13171317
// for the queue to drain enough to execute it (indicating we are caught up
13181318
// at least with the time we entered this function).
13191319
uint256 last_block_hash = WITH_LOCK(cs_wallet, return m_last_block_processed);

0 commit comments

Comments
 (0)