From 1ddde10564b94dee224c2b11a09932de0fc55013 Mon Sep 17 00:00:00 2001 From: alex Date: Sun, 19 Jan 2014 17:46:56 +0400 Subject: [PATCH 1/1] Don't reaccept coinstakes --- src/rpcmining.cpp | 2 +- src/wallet.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 72b850e..84cd21e 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -372,7 +372,7 @@ Value getblocktemplate(const Array& params, bool fHelp) uint256 txHash = tx.GetHash(); setTxIndex[txHash] = i++; - if (tx.IsCoinBase()) + if (tx.IsCoinBase() || tx.IsCoinStake()) continue; Object entry; diff --git a/src/wallet.cpp b/src/wallet.cpp index 9c43804..12799fd 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -830,7 +830,7 @@ void CWallet::ReacceptWalletTransactions() BOOST_FOREACH(PAIRTYPE(const uint256, CWalletTx)& item, mapWallet) { CWalletTx& wtx = item.second; - if (wtx.IsCoinBase() && wtx.IsSpent(0)) + if ((wtx.IsCoinBase() && wtx.IsSpent(0)) || (wtx.IsCoinStake() && wtx.IsSpent(1))) continue; CCoins coins; @@ -860,7 +860,7 @@ void CWallet::ReacceptWalletTransactions() else { // Re-accept any txes of ours that aren't already in a block - if (!wtx.IsCoinBase()) + if (!(wtx.IsCoinBase() || wtx.IsCoinStake())) wtx.AcceptWalletTransaction(false); } } @@ -878,14 +878,14 @@ void CWalletTx::RelayWalletTransaction() CCoinsViewCache& coins = *pcoinsTip; BOOST_FOREACH(const CMerkleTx& tx, vtxPrev) { - if (!tx.IsCoinBase()) + if (!(tx.IsCoinBase() || tx.IsCoinStake())) { uint256 hash = tx.GetHash(); if (!coins.HaveCoins(hash)) RelayTransaction((CTransaction)tx, hash); } } - if (!IsCoinBase()) + if (!(IsCoinBase() || IsCoinStake())) { uint256 hash = GetHash(); if (!coins.HaveCoins(hash)) -- 1.7.1