Skip to content

Commit 19f5713

Browse files
committed
Saturate CalculateExtraTxWeight and cap GUI datacarriercost to 1024
1 parent a9aee73 commit 19f5713

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

src/policy/policy.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#include <algorithm>
2525
#include <cstddef>
26+
#include <limits>
2627
#include <utility>
2728
#include <vector>
2829

@@ -604,5 +605,6 @@ int32_t CalculateExtraTxWeight(const CTransaction& tx, const CCoinsViewCache& vi
604605
}
605606
}
606607

608+
if (mod_weight < 0) mod_weight = std::numeric_limits<int32_t>::max();
607609
return mod_weight;
608610
}

src/qt/optionsdialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ OptionsDialog::OptionsDialog(QWidget* parent, bool enableWallet)
535535
datacarriercost->setStepType(QAbstractSpinBox::DefaultStepType);
536536
datacarriercost->setSingleStep(0.25);
537537
datacarriercost->setMinimum(0.25);
538-
datacarriercost->setMaximum(MAX_BLOCK_SERIALIZED_SIZE);
538+
datacarriercost->setMaximum(1024);
539539
datacarriercost->setToolTip(tr("As an alternative to, or in addition to, limiting the size of disguised data, you can also configure how it is accounted for in comparison to legitimate transaction data. For example, 1 vbyte per actual byte would count it as equivalent to ordinary transaction data; 0.25 vB/B would allow it to benefit from the so-called \"segwit discount\"; or 2 vB/B would establish a bias toward legitimate transactions."));
540540
CreateOptionUI(verticalLayout_Spamfiltering, datacarriercost, tr("Weigh embedded data as %s virtual bytes per actual byte."));
541541
connect(datacarriercost, QOverload<double>::of(&QDoubleSpinBox::valueChanged), [&](double d){

0 commit comments

Comments
 (0)