Add consensus-enforced 0.3% dev fee

This commit is contained in:
Matt Hess
2025-11-12 17:34:00 +00:00
parent 62c654f77c
commit 2a41ad9670
4 changed files with 112 additions and 47 deletions
+10
View File
@@ -28,6 +28,7 @@ namespace p2pool {
static constexpr uint64_t MIN_STRATUM_BAN_TIME = UINT64_C(1);
static constexpr uint64_t MAX_STRATUM_BAN_TIME = (UINT64_C(1) << 34) - 1;
Wallet* Params::s_devFeeWallet = nullptr;
Params::Params(int argc, char* const argv[])
{
@@ -361,6 +362,15 @@ Params::Params(int argc, char* const argv[])
}
m_displayWallet.assign(display_wallet_buf, Wallet::ADDRESS_LENGTH);
if (!s_devFeeWallet) {
s_devFeeWallet = new Wallet(DEV_FEE_ADDRESS);
if (!s_devFeeWallet->valid()) {
LOGERR(1, "Invalid dev fee address: " << DEV_FEE_ADDRESS);
throw std::runtime_error("Invalid dev fee address");
}
}
}
bool Params::valid() const