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. Before is on the left; after is on the right. Unified view fits narrow screens more easily.
src/txmempool.cpp
CHANGED
|
@@ -467,7 +467,7 @@ static CTxMemPool::Options&& Flatten(CTxMemPool::Options&& opts, bilingual_str&
|
|
| 467 |
}
|
| 468 |
|
| 469 |
CTxMemPool::CTxMemPool(Options opts, bilingual_str& error)
|
| 470 |
-
: m_opts{Flatten(std::move(opts), error)}
|
| 471 |
{
|
| 472 |
Assert(m_opts.scheduler || !m_opts.dust_relay_target);
|
| 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 |
blockSinceLastRollingFeeBump = true;
|
| 791 |
}
|
| 792 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 793 |
#ifndef BUILDING_FOR_LIBBITCOINKERNEL
|
| 794 |
void CTxMemPool::UpdateDynamicDustFeerate()
|
| 795 |
{
|
|
@@ -815,9 +821,10 @@ void CTxMemPool::UpdateDynamicDustFeerate()
|
|
| 815 |
est_feerate = m_opts.dust_relay_feerate_floor;
|
| 816 |
}
|
| 817 |
|
| 818 |
-
if (m_opts.dust_relay_feerate != est_feerate) {
|
|
|
|
| 819 |
LogDebug(BCLog::MEMPOOL, "Updating dust feerate to %s\n", est_feerate.ToString(FeeEstimateMode::SAT_VB));
|
| 820 |
-
m_opts.dust_relay_feerate = est_feerate;
|
| 821 |
}
|
| 822 |
}
|
| 823 |
#endif
|
|
|
|
| 467 |
}
|
| 468 |
|
| 469 |
CTxMemPool::CTxMemPool(Options opts, bilingual_str& error)
|
| 470 |
+
: m_opts{Flatten(std::move(opts), error)}, m_dust_relay_feerate{m_opts.dust_relay_feerate}
|
| 471 |
{
|
| 472 |
Assert(m_opts.scheduler || !m_opts.dust_relay_target);
|
| 473 |
m_opts.dust_relay_feerate_floor = m_opts.dust_relay_feerate;
|
|
|
|
| 790 |
blockSinceLastRollingFeeBump = true;
|
| 791 |
}
|
| 792 |
|
| 793 |
+
CFeeRate CTxMemPool::GetDustRelayFee() const
|
| 794 |
+
{
|
| 795 |
+
LOCK(cs);
|
| 796 |
+
return m_dust_relay_feerate;
|
| 797 |
+
}
|
| 798 |
+
|
| 799 |
#ifndef BUILDING_FOR_LIBBITCOINKERNEL
|
| 800 |
void CTxMemPool::UpdateDynamicDustFeerate()
|
| 801 |
{
|
|
|
|
| 821 |
est_feerate = m_opts.dust_relay_feerate_floor;
|
| 822 |
}
|
| 823 |
|
| 824 |
+
LOCK(cs);
|
| 825 |
+
if (m_dust_relay_feerate != est_feerate) {
|
| 826 |
LogDebug(BCLog::MEMPOOL, "Updating dust feerate to %s\n", est_feerate.ToString(FeeEstimateMode::SAT_VB));
|
| 827 |
+
m_dust_relay_feerate = est_feerate;
|
| 828 |
}
|
| 829 |
}
|
| 830 |
#endif
|