Skip to content

Commit

Permalink
VpnCoin 1.1.3.2, Fix Check Transaction MIN_TXOUT_AMOUNT bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Bit-Net committed Oct 28, 2015
1 parent e850d5a commit d755076
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#define CLIENT_VERSION_MAJOR 1
#define CLIENT_VERSION_MINOR 1
#define CLIENT_VERSION_REVISION 3
#define CLIENT_VERSION_BUILD 1
#define CLIENT_VERSION_BUILD 2

// Converts the parameter X to a string after macro replacement on X has been performed.
// Don't merge these into one macro!
Expand Down
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ int CMerkleTx::SetMerkleBranch(const CBlock* pblock)



bool CTransaction::CheckTransaction() const
bool CTransaction::CheckTransaction(bool bChkMiniValue) const
{
// Basic checks that don't depend on any context
if (vin.empty())
Expand All @@ -565,7 +565,7 @@ bool CTransaction::CheckTransaction() const
const CTxOut& txout = vout[i];
if (txout.IsEmpty() && !IsCoinBase() && !IsCoinStake())
return DoS(100, error("CTransaction::CheckTransaction() : txout empty for user transaction"));
if( nBestHeight >= NewTxFee_RewardCoinYear_Active_Height )
if( bChkMiniValue && (nBestHeight >= NewTxFee_RewardCoinYear_Active_Height) )
{
if ((!txout.IsEmpty()) && txout.nValue < MIN_TXOUT_AMOUNT)
return DoS(100, error("CTransaction::CheckTransaction() : txout.nValue below minimum"));
Expand Down
2 changes: 1 addition & 1 deletion src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ class CTransaction
bool ConnectInputs(CTxDB& txdb, MapPrevTx inputs,
std::map<uint256, CTxIndex>& mapTestPool, const CDiskTxPos& posThisTx,
const CBlockIndex* pindexBlock, bool fBlock, bool fMiner);
bool CheckTransaction() const;
bool CheckTransaction(bool bChkMiniValue = true) const;
bool GetCoinAge(CTxDB& txdb, uint64_t& nCoinAge) const; // ppcoin: get transaction coin age

protected:
Expand Down
1 change: 1 addition & 0 deletions src/txdb-leveldb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ bool CTxDB::LoadBlockIndex()
{
if (fRequestShutdown || pindex->nHeight < nBestHeight-nCheckDepth)
break;
if( pindex->nHeight < NewTxFee_RewardCoinYear_Active_Height ) break; // 2015.10.28 add
CBlock block;
if (!block.ReadFromDisk(pindex))
return error("LoadBlockIndex() : block.ReadFromDisk failed");
Expand Down
2 changes: 1 addition & 1 deletion src/walletdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue,
ssKey >> hash;
CWalletTx& wtx = pwallet->mapWallet[hash];
ssValue >> wtx;
if (wtx.CheckTransaction() && (wtx.GetHash() == hash))
if (wtx.CheckTransaction(false) && (wtx.GetHash() == hash))
wtx.BindWallet(pwallet);
else
{
Expand Down

0 comments on commit d755076

Please sign in to comment.