Skip to content

Commit f959d9f

Browse files
NateIsernclaude
andcommitted
Fix masternode registration: collateral check used wrong amount + empty obfuscation dummy address
Masternodes could never register on FairCoin v3 (every `masternode start-alias` was silently rejected with "mnb - Rejected Masternode entry"). Two bugs in the collateral validation: - CheckInputsAndAdd / CMasternodeBroadcast built the collateral-check dummy tx with a hardcoded 9999.99 COIN output (a PIVX 10000-collateral leftover), but FairCoin's collateral is MASTER_NODE_AMOUNT = 5000. So AcceptableInputs/CheckInputs failed with "value in (5000) < value out (9999.99)". Fixed to 4999.99 (collateral minus 0.01 fee margin) in all three sites: src/masternode.cpp:214, src/masternode.cpp:575, src/masternodeman.cpp:962. - strObfuscationPoolDummyAddress was "" (empty) in chainparams (mainnet), so CObfuscationPool::SetCollateralAddress logged "Invalid Obfuscation collateral address" and collateralPubKey stayed empty. Set it to a valid FairCoin address (used only to build the never-broadcast collateral-check tx). Verified in production: with both fixes, `masternode start-alias` is accepted ("Got NEW Masternode entry"), the masternode shows status ENABLED across all nodes, and blocks pay the masternode 5 FAIR with SPORK_8 enforcement on. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent dff0eeb commit f959d9f

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/chainparams.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ class CMainParams : public CChainParams
434434

435435
nPoolMaxTransactions = 3;
436436
strSporkKey = "044072106100b738bb99d24f2230708ebebdca687a01f8d0ce138551da829cf4e28ac499242806279787afc5293c97b72694f111e91c376cdb0d0fda8778ad4425";
437-
strObfuscationPoolDummyAddress = "";
437+
strObfuscationPoolDummyAddress = "FRZou2ApnnNyHGJRqoHgVLDF71Yviuhfz2"; // valid FairCoin addr; used only to build the collateral-check dummy tx (must be standard, never broadcast)
438438
nStartMasternodePayments = 1744156800; // April 9, 2026
439439
}
440440

src/masternode.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ void CMasternode::Check(bool forceCheck)
211211
if (!unitTest) {
212212
CValidationState state;
213213
CMutableTransaction tx = CMutableTransaction();
214-
CTxOut vout = CTxOut(9999.99 * COIN, obfuscationPool.collateralPubKey);
214+
CTxOut vout = CTxOut(4999.99 * COIN, obfuscationPool.collateralPubKey); // MASTER_NODE_AMOUNT (5000) minus 0.01 fee margin
215215
tx.vin.push_back(vin);
216216
tx.vout.push_back(vout);
217217

@@ -572,7 +572,7 @@ bool CMasternodeBroadcast::CheckInputsAndAdd(int& nDoS)
572572

573573
CValidationState state;
574574
CMutableTransaction tx = CMutableTransaction();
575-
CTxOut vout = CTxOut(9999.99 * COIN, obfuscationPool.collateralPubKey);
575+
CTxOut vout = CTxOut(4999.99 * COIN, obfuscationPool.collateralPubKey); // MASTER_NODE_AMOUNT (5000) minus 0.01 fee margin
576576
tx.vin.push_back(vin);
577577
tx.vout.push_back(vout);
578578

src/masternodeman.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData
959959

960960
CValidationState state;
961961
CMutableTransaction tx = CMutableTransaction();
962-
CTxOut vout = CTxOut(9999.99 * COIN, obfuscationPool.collateralPubKey);
962+
CTxOut vout = CTxOut(4999.99 * COIN, obfuscationPool.collateralPubKey); // MASTER_NODE_AMOUNT (5000) minus 0.01 fee margin
963963
tx.vin.push_back(vin);
964964
tx.vout.push_back(vout);
965965

0 commit comments

Comments
 (0)