Fixed Propagation Of Budgets / Proto Bump

This commit is contained in:
Evan Duffield 2015-07-13 20:03:08 -07:00
parent 6fa0d23714
commit bee6941195
8 changed files with 38 additions and 13 deletions

View File

@ -3,7 +3,7 @@ AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 0)
define(_CLIENT_VERSION_MINOR, 12)
define(_CLIENT_VERSION_REVISION, 0)
define(_CLIENT_VERSION_BUILD, 14)
define(_CLIENT_VERSION_BUILD, 15)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2015)
AC_INIT([Dash Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[info@dashpay.io],[dash])

View File

@ -17,7 +17,7 @@
#define CLIENT_VERSION_MAJOR 0
#define CLIENT_VERSION_MINOR 12
#define CLIENT_VERSION_REVISION 0
#define CLIENT_VERSION_BUILD 14
#define CLIENT_VERSION_BUILD 15
//! Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE true

View File

@ -2363,7 +2363,7 @@ void ThreadCheckDarkSendPool()
CBlockIndex* pindexPrev = chainActive.Tip();
if(pindexPrev != NULL) {
if(pindexPrev->nTime > GetAdjustedTime() - 60)
if(pindexPrev->nTime > GetAdjustedTime() - 600)
{
LOCK(cs_vNodes);

View File

@ -27,7 +27,7 @@ class CConsensusVote;
class CTransaction;
class CTransactionLock;
static const int MIN_INSTANTX_PROTO_VERSION = 70088;
static const int MIN_INSTANTX_PROTO_VERSION = 70089;
extern map<uint256, CTransaction> mapTxLockReq;
extern map<uint256, CTransaction> mapTxLockReqRejected;

View File

@ -888,6 +888,22 @@ int GetInputAgeIX(uint256 nTXHash, CTxIn& vin)
return -1;
}
int GetIXConfirmations(uint256 nTXHash)
{
int sigs = 0;
std::map<uint256, CTransactionLock>::iterator i = mapTxLocks.find(nTXHash);
if (i != mapTxLocks.end()){
sigs = (*i).second.CountSignatures();
}
if(sigs >= INSTANTX_SIGNATURES_REQUIRED){
return nInstantXDepth;
}
return 0;
}
bool CheckTransaction(const CTransaction& tx, CValidationState &state)
{
// Basic checks that don't depend on any context

View File

@ -234,8 +234,8 @@ bool AcceptableInputs(CTxMemPool& pool, CValidationState &state, const CTransact
bool* pfMissingInputs, bool fRejectInsaneFee=false, bool ignoreFees=false);
int GetInputAge(CTxIn& vin);
// get age + lock confirmations
int GetInputAgeIX(uint256 nTXHash, CTxIn& vin);
int GetIXConfirmations(uint256 nTXHash);
struct CNodeStateStats {
int nMisbehavior;

View File

@ -38,8 +38,8 @@ int GetBudgetPaymentCycleBlocks(){
bool IsBudgetCollateralValid(uint256 nTxCollateralHash, uint256 nExpectedHash, std::string& strError)
{
CTransaction txCollateral;
uint256 hash;
if(!GetTransaction(nTxCollateralHash, txCollateral, hash, true)){
uint256 nBlockHash;
if(!GetTransaction(nTxCollateralHash, txCollateral, nBlockHash, true)){
strError = "Can't find collateral tx %s\n", txCollateral.ToString().c_str();
LogPrintf ("CBudgetProposalBroadcast::FeeTXValid - Can't find collateral tx %s\n", txCollateral.ToString().c_str());
return false;
@ -67,8 +67,17 @@ bool IsBudgetCollateralValid(uint256 nTxCollateralHash, uint256 nExpectedHash, s
return false;
}
CTxIn in(COutPoint(txCollateral.GetHash(), 0));
int conf = GetInputAgeIX(txCollateral.GetHash(), in);
int conf = -1;
if (nBlockHash != 0) {
BlockMap::iterator mi = mapBlockIndex.find(nBlockHash);
if (mi != mapBlockIndex.end() && (*mi).second) {
CBlockIndex* pindex = (*mi).second;
if (chainActive.Contains(pindex)) {
conf = GetIXConfirmations(nTxCollateralHash) + (1 + chainActive.Height() - pindex->nHeight);
}
}
}
if(conf < BUDGET_FEE_CONFIRMATIONS){
strError = "Collateral requires at least 6 confirmations - " + boost::lexical_cast<std::string>(conf) + " confirmations ";
LogPrintf ("CBudgetProposalBroadcast::IsBudgetCollateralValid - Collateral requires at least 6 confirmations - %s - %d confirmations\n", txCollateral.GetHash().ToString(), conf);

View File

@ -10,7 +10,7 @@
* network protocol versioning
*/
static const int PROTOCOL_VERSION = 70088;
static const int PROTOCOL_VERSION = 70089;
//! initial proto version, to be increased after version/verack negotiation
static const int INIT_PROTO_VERSION = 209;
@ -22,16 +22,16 @@ static const int GETHEADERS_VERSION = 70077;
static const int MIN_PEER_PROTO_VERSION = 70066;
//! minimum peer version accepted by DarksendPool
static const int MIN_POOL_PEER_PROTO_VERSION = 70088;
static const int MIN_POOL_PEER_PROTO_VERSION = 70089;
//! minimum peer version for masternode budgets
static const int MIN_BUDGET_PEER_PROTO_VERSION = 70088;
static const int MIN_BUDGET_PEER_PROTO_VERSION = 70089;
//! minimum peer version that can receive masternode payments
// V1 - Last protocol version before update
// V2 - Newest protocol version
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_1 = 70066;
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_2 = 70088;
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_2 = 70089;
//! nTime field added to CAddress, starting with this version;
//! if possible, avoid requesting addresses nodes older than this