From 1e4dc21cd989dedc55b4f4bd1f5da95284e2510c Mon Sep 17 00:00:00 2001 From: lateminer <9951982+lateminer@users.noreply.github.com> Date: Sun, 5 Nov 2023 23:27:49 +0100 Subject: [PATCH] backports: Do not split rewards if vDevFundAddress is empty https://github.com/lateminer/blackcoin-more/commit/2acdcedf0d479beb780d1da06d87af51fa556e89 --- src/chainparams.cpp | 2 +- src/wallet/wallet.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index a3051e593d..93d0e3cc32 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -373,7 +373,7 @@ void UpdateRegtestBIP9Parameters(Consensus::DeploymentPos d, int64_t nStartTime, // Blackcoin: Donations to dev fund std::string CChainParams::GetDevFundAddress() const { - return vDevFundAddress[0]; + return !vDevFundAddress.empty() ? vDevFundAddress[0] : ""; } CScript CChainParams::GetDevRewardScript() const diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 4741e9496e..f70ca0ebee 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -821,7 +821,7 @@ bool CWallet::CreateCoinStake(const CKeyStore& keystore, unsigned int nBits, int } // Blackcoin: Donate to dev fund (or not) - if (nDonationPercentage > 0) { + if (nDonationPercentage > 0 && !Params().GetDevFundAddress().empty()) { CAmount nDevCredit = 0; CAmount nMinerCredit = 0;