Skip to content

Commit

Permalink
Merge pull request #162 from bulwark-crypto/dev
Browse files Browse the repository at this point in the history
v2.1.1.0
  • Loading branch information
dustinengle committed Jan 9, 2019
2 parents 06e2fa5 + ea3d853 commit c26fac3
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 8 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 2)
define(_CLIENT_VERSION_MINOR, 1)
define(_CLIENT_VERSION_REVISION, 0)
define(_CLIENT_VERSION_REVISION, 1)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2018)
Expand Down
13 changes: 13 additions & 0 deletions doc/release-notes/bulwark-2.1.1.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Bulwark 2.1.1.0

__Mandatory Update__

Bulwark 2.1.1.0 is a mandatory update to address a potential future issue with new staking requirements once the staking requirements spork is activated. The spork is not active at this time, will be at a later date after amble time has been given to update, this is a preventative measure.

## Technical
- Update to stake consensus requirements

## Miscellaneous
- Remove extra debug log entry
- Update to v2.1.1.0
- Minor format change
2 changes: 1 addition & 1 deletion src/clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
//! These need to be macros, as clientversion.cpp's and bulwark*-res.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 2
#define CLIENT_VERSION_MINOR 1
#define CLIENT_VERSION_REVISION 0
#define CLIENT_VERSION_REVISION 1
#define CLIENT_VERSION_BUILD 0

//! Set to true for release, false for prerelease or test build
Expand Down
32 changes: 26 additions & 6 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4192,12 +4192,32 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo
if (block.vtx[i].IsCoinStake())
return state.DoS(100, error("CheckBlock() : more than one coinstake"));

// If consensus level checks are in place then make sure
// the min. value is provided in tx.
if (IsSporkActive(SPORK_23_STAKING_REQUIREMENTS)
&& block.GetBlockTime() >= GetSporkValue(SPORK_23_STAKING_REQUIREMENTS)
&& block.vtx[1].vout[1].nValue < Params().Stake_MinAmount()) {
return state.DoS(100, error("CheckBlock() : under min. stake value"));
// If consensus level checks are in place.
if (IsSporkActive(SPORK_23_STAKING_REQUIREMENTS) && block.GetBlockTime() >= GetSporkValue(SPORK_23_STAKING_REQUIREMENTS)) {
// Check for minimum value.
if (block.vtx[1].vout[1].nValue < Params().Stake_MinAmount())
return state.DoS(100, error("CheckBlock() : stake under min. stake value"));

// Check for coin age.
// First try finding the previous transaction in database.
CTransaction txPrev;
uint256 hashBlockPrev;
if (!GetTransaction(block.vtx[1].vin[0].prevout.hash, txPrev, hashBlockPrev, true))
return state.DoS(100, error("CheckBlock() : stake failed to find vin transaction"));
// Find block in map.
CBlockIndex* pindex = NULL;
BlockMap::iterator it = mapBlockIndex.find(hashBlockPrev);
if (it != mapBlockIndex.end())
pindex = it->second;
else
return state.DoS(100, error("CheckBlock() : stake failed to find block index"));
// Check block time vs stake age requirement.
if (pindex->GetBlockHeader().nTime + nStakeMinAge > GetAdjustedTime())
return state.DoS(100, error("CheckBlock() : stake under min. stake age"));

// Check that the prev. stake block has required confirmations by height.
if (chainActive.Tip()->nHeight - pindex->nHeight < Params().Stake_MinConfirmations())
return state.DoS(100, error("CheckBlock() : stake under min. required confirmations"));
}
}

Expand Down
1 change: 1 addition & 0 deletions src/masternode-budget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,7 @@ CAmount CBudgetManager::GetTotalBudget(int nHeight) {
nSubsidy = 4.688 * COIN;
} else if (nHeight <= 1382400 && nHeight > 1296000) {
nSubsidy = 3.906 * COIN;

// POS Year 4
} else if (nHeight <= 1468800 && nHeight > 1382400) {
nSubsidy = 3.125 * COIN;
Expand Down

0 comments on commit c26fac3

Please sign in to comment.