mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
Introduce -blockmintxfee
This commit is contained in:
parent
123ea73624
commit
daec955fd6
4 changed files with 21 additions and 2 deletions
|
|
@ -95,12 +95,18 @@ BlockAssembler::BlockAssembler(const CChainParams& _chainparams)
|
|||
nBlockMaxWeight = nBlockMaxSize * WITNESS_SCALE_FACTOR;
|
||||
}
|
||||
}
|
||||
if (IsArgSet("-blockmintxfee")) {
|
||||
CAmount n = 0;
|
||||
ParseMoney(GetArg("-blockmintxfee", ""), n);
|
||||
blockMinFeeRate = CFeeRate(n);
|
||||
} else {
|
||||
blockMinFeeRate = CFeeRate(DEFAULT_BLOCK_MIN_TX_FEE);
|
||||
}
|
||||
|
||||
// Limit weight to between 4K and MAX_BLOCK_WEIGHT-4K for sanity:
|
||||
nBlockMaxWeight = std::max((unsigned int)4000, std::min((unsigned int)(MAX_BLOCK_WEIGHT-4000), nBlockMaxWeight));
|
||||
// Limit size to between 1K and MAX_BLOCK_SERIALIZED_SIZE-1K for sanity:
|
||||
nBlockMaxSize = std::max((unsigned int)1000, std::min((unsigned int)(MAX_BLOCK_SERIALIZED_SIZE-1000), nBlockMaxSize));
|
||||
|
||||
// Whether we need to account for byte usage (in addition to weight usage)
|
||||
fNeedSizeAccounting = (nBlockMaxSize < MAX_BLOCK_SERIALIZED_SIZE-1000);
|
||||
}
|
||||
|
|
@ -460,7 +466,7 @@ void BlockAssembler::addPackageTxs()
|
|||
packageSigOpsCost = modit->nSigOpCostWithAncestors;
|
||||
}
|
||||
|
||||
if (packageFees < ::minRelayTxFee.GetFee(packageSize)) {
|
||||
if (packageFees < blockMinFeeRate.GetFee(packageSize)) {
|
||||
// Everything else we might consider has a lower fee rate
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue