Browse Source

Merge pull request #1971 from sipa/bugfix_norelayspent

Bugfix: do not keep relaying spent wallet transactions
miguelfreitas
Pieter Wuille 12 years ago
parent
commit
a56d3f8a10
  1. 14
      src/wallet.cpp

14
src/wallet.cpp

@ -820,21 +820,17 @@ void CWallet::ReacceptWalletTransactions() @@ -820,21 +820,17 @@ void CWallet::ReacceptWalletTransactions()
void CWalletTx::RelayWalletTransaction()
{
CCoinsViewCache& coins = *pcoinsTip;
BOOST_FOREACH(const CMerkleTx& tx, vtxPrev)
{
if (!tx.IsCoinBase())
{
uint256 hash = tx.GetHash();
if (!coins.HaveCoins(hash))
RelayMessage(CInv(MSG_TX, hash), (CTransaction)tx);
if (!tx.IsCoinBase()) {
if (tx.GetDepthInMainChain() == 0)
RelayMessage(CInv(MSG_TX, tx.GetHash()), (CTransaction)tx);
}
}
if (!IsCoinBase())
{
uint256 hash = GetHash();
if (!coins.HaveCoins(hash))
{
if (GetDepthInMainChain() == 0) {
uint256 hash = GetHash();
printf("Relaying wtx %s\n", hash.ToString().substr(0,10).c_str());
RelayMessage(CInv(MSG_TX, hash), (CTransaction)*this);
}

Loading…
Cancel
Save