Skip to content

Commit

Permalink
two more files...
Browse files Browse the repository at this point in the history
  • Loading branch information
micryon committed May 16, 2014
1 parent 78904e2 commit c2d68fb
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
9 changes: 7 additions & 2 deletions src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static const int DATABASE_VERSION = 70509;
// network protocol versioning
//

static const int PROTOCOL_VERSION = 60013;
static const int PROTOCOL_VERSION = 60006;

// earlier versions not supported as of Feb 2012, and are disconnected
static const int MIN_PROTO_VERSION = 209;
Expand All @@ -41,12 +41,17 @@ static const int CADDR_TIME_VERSION = 31402;

// only request blocks from nodes outside this range of versions
static const int NOBLKS_VERSION_START = 60002;
static const int NOBLKS_VERSION_END = 60006;
static const int NOBLKS_VERSION_END = 60004;

// BIP 0031, pong message, is enabled for all versions AFTER this one
static const int BIP0031_VERSION = 60000;

// "mempool" command, enhanced "getdata" behavior starts with this version:
static const int MEMPOOL_GD_VERSION = 60002;

#define DISPLAY_VERSION_MAJOR 2
#define DISPLAY_VERSION_MINOR 1
#define DISPLAY_VERSION_REVISION 0
#define DISPLAY_VERSION_BUILD 0

#endif
20 changes: 17 additions & 3 deletions src/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1738,11 +1738,11 @@ bool CWallet::CreateCoinStake(const CKeyStore& keystore, unsigned int nBits, int
// Set output amount
if (txNew.vout.size() == 3)
{
txNew.vout[1].nValue = (nCredit / 2 / CENT) * CENT;
txNew.vout[2].nValue = nCredit - txNew.vout[1].nValue;
txNew.vout[1].nValue = ((nCredit - nMinFee) / 2 / CENT) * CENT;
txNew.vout[2].nValue = nCredit - nMinFee - txNew.vout[1].nValue;
}
else
txNew.vout[1].nValue = nCredit;
txNew.vout[1].nValue = nCredit - nMinFee;

// Sign
int nIn = 0;
Expand All @@ -1757,6 +1757,20 @@ bool CWallet::CreateCoinStake(const CKeyStore& keystore, unsigned int nBits, int
if (nBytes >= MAX_BLOCK_SIZE_GEN/5)
return error("CreateCoinStake : exceeded coinstake size limit");

// Check enough fee is paid
if (nMinFee < txNew.GetMinFee() - MIN_TX_FEE)
{
nMinFee = txNew.GetMinFee() - MIN_TX_FEE;
continue; // try signing again
}
else
{
if (fDebug && GetBoolArg("-printfee"))
printf("CreateCoinStake : fee for coinstake %s\n", FormatMoney(nMinFee).c_str());
break;
}
}

// Successfully generated coinstake
return true;
}
Expand Down

0 comments on commit c2d68fb

Please sign in to comment.