Skip to content

Commit

Permalink
Merge pull request #214 from RunOnFlux/bugfixes
Browse files Browse the repository at this point in the history
Bugfixes for v6.1.0
  • Loading branch information
TheTrunk authored Jan 31, 2023
2 parents 8dc245f + 2d2736b commit 782daee
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7605,7 +7605,11 @@ CMutableTransaction CreateNewContextualCMutableTransaction(const Consensus::Para
return mtx;
}

unsigned int GetMaxReorgDepth(const int64_t nHeight) {
/** This must always be a signed int. Because when comparing it to the chainActive.Height()
we need to compare similar types or i < j will not function correctly
You must compare (int < int) because (int < unsigned int) can give incorrectly results
*/
int64_t GetMaxReorgDepth(const int64_t nHeight) {
if (nHeight > MAX_REORG_LENGTH_UPDATED_HEIGHT) {
return MAX_REORG_LENGTH_UPDATED;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ CAmount GetFluxnodeSubsidy(int nHeight, const CAmount& blockValue, int nNodeTier
CAmount GetExchangeFundAmount(int nHeight, const Consensus::Params& consensusParams);
CAmount GetFoundationFundAmount(int nHeight, const Consensus::Params& consensusParams);
bool IsSwapPoolInterval(const int64_t nHeight);
unsigned int GetMaxReorgDepth(const int64_t nHeight);
int64_t GetMaxReorgDepth(const int64_t nHeight);

/**
* Prune block and undo files (blk???.dat and undo???.dat) so that the disk space used is less than a user-defined target.
Expand Down
10 changes: 7 additions & 3 deletions src/rpc/mining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -746,11 +746,15 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp)
CTxDestination dest;
ExtractDestination(payout.second.first, dest);

result.pushKV(std::string(start + "_fluxnode_address"), EncodeDestination(dest));
result.pushKV(std::string(start + "_fluxlnode_payout"), payout.second.second);

/** Only use named (cumulus, nimbus, stratus) when using fluxnode naming scheme */
result.pushKV(std::string(start_rename + "_fluxnode_address"), EncodeDestination(dest));
result.pushKV(std::string(start_rename + "_fluxnode_payout"), payout.second.second);

/** We must keep zelnode here for backwards capabilities so pools don't break when they upgrade to latest releases */
result.pushKV(std::string(start + "_zelnode_address"), EncodeDestination(dest));
result.pushKV(std::string(start + "_zelnode_payout"), payout.second.second);
result.pushKV(std::string(start_rename + "_zelnode_address"), EncodeDestination(dest));
result.pushKV(std::string(start_rename + "_zelnode_payout"), payout.second.second);
}

// These should never be on the same block. So to keep it clean for pools we will use the same
Expand Down

0 comments on commit 782daee

Please sign in to comment.