v30.3-roots.1 · Commit 51: [PATCH 51/68] mempool: synchronize dynamic dust fee publication
src/txmempool.cpp
Before: src/txmempool.cpp · After: src/txmempool.cpp
File metadata
index 17ca9abc1c843b5ee54e2de9f97d56d041bba150..376db0fe16c02a1703f71edb2280f048246a8b5c 100644
Download original patch · Release notes
Diff rows 1–32 of 32. Line numbers refer to the original before/after files.
+ Added− RemovedUnmarked lines are context.
Scroll the code area horizontally to read long lines. The two line-number columns refer to before and after.
src/txmempool.cpp
CHANGED
|
@@ -467,7 +467,7 @@ static CTxMemPool::Options&& Flatten(CTxMemPool::Options&& opts, bilingual_str&
|
|
|
467
467
|
}
|
|
468
468
|
|
|
469
469
|
CTxMemPool::CTxMemPool(Options opts, bilingual_str& error)
|
|
470
|
-
: m_opts{Flatten(std::move(opts), error)}
|
|
470
|
+
: m_opts{Flatten(std::move(opts), error)}, m_dust_relay_feerate{m_opts.dust_relay_feerate}
|
|
471
471
|
{
|
|
472
472
|
Assert(m_opts.scheduler || !m_opts.dust_relay_target);
|
|
473
473
|
m_opts.dust_relay_feerate_floor = m_opts.dust_relay_feerate;
|
|
@@ -790,6 +790,12 @@ void CTxMemPool::removeForBlock(const std::vector<CTransactionRef>& vtx, unsigne
|
|
|
790
790
|
blockSinceLastRollingFeeBump = true;
|
|
791
791
|
}
|
|
792
792
|
|
|
793
|
+
CFeeRate CTxMemPool::GetDustRelayFee() const
|
|
794
|
+
{
|
|
795
|
+
LOCK(cs);
|
|
796
|
+
return m_dust_relay_feerate;
|
|
797
|
+
}
|
|
798
|
+
|
|
793
799
|
#ifndef BUILDING_FOR_LIBBITCOINKERNEL
|
|
794
800
|
void CTxMemPool::UpdateDynamicDustFeerate()
|
|
795
801
|
{
|
|
@@ -815,9 +821,10 @@ void CTxMemPool::UpdateDynamicDustFeerate()
|
|
|
815
821
|
est_feerate = m_opts.dust_relay_feerate_floor;
|
|
816
822
|
}
|
|
817
823
|
|
|
818
|
-
if (m_opts.dust_relay_feerate != est_feerate) {
|
|
824
|
+
LOCK(cs);
|
|
825
|
+
if (m_dust_relay_feerate != est_feerate) {
|
|
819
826
|
LogDebug(BCLog::MEMPOOL, "Updating dust feerate to %s\n", est_feerate.ToString(FeeEstimateMode::SAT_VB));
|
|
820
|
-
m_opts.dust_relay_feerate = est_feerate;
|
|
827
|
+
m_dust_relay_feerate = est_feerate;
|
|
821
828
|
}
|
|
822
829
|
}
|
|
823
830
|
#endif
|