MCPcopy Create free account
hub / github.com/LUX-Core/lux / SelectMasternodePayee

Function SelectMasternodePayee

src/masternode.cpp:918–933  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

916}
917
918bool SelectMasternodePayee(CScript& payeeScript) {
919 bool result = false;
920 if (MasternodePaymentsEnabled()) {
921 //spork
922 if (!masternodePayments.GetBlockPayee(chainActive.Height() + 1, payeeScript)) {
923 int winningNode = GetCurrentMasterNode(1);
924 if (winningNode >= 0) {
925 payeeScript = GetScriptForDestination(vecMasternodes[winningNode].pubkey.GetID());
926 result = true;
927 } else {
928 LogPrintf("%s: Failed to detect masternode to pay\n", __func__);
929 }
930 }
931 }
932 return result;
933}

Callers 3

CreateNewBlockMethod · 0.85
CreateCoinStakeMethod · 0.85

Calls 6

GetCurrentMasterNodeFunction · 0.85
GetScriptForDestinationFunction · 0.85
GetBlockPayeeMethod · 0.80
HeightMethod · 0.80
GetIDMethod · 0.45

Tested by

no test coverage detected