Browse Source

Refuse to retransmit transactions without vins

Versions of bitcoin before 0.8.6 have a bug that inserted
empty transactions into the vtxPrev in the wallet, which will cause the node to be
banned when retransmitted, hence add a check for !tx.vin.empty()
before RelayTransaction.
0.10
Wladimir J. van der Laan 11 years ago
parent
commit
4ef92a9067
  1. 5
      src/wallet.cpp

5
src/wallet.cpp

@ -895,7 +895,10 @@ void CWalletTx::RelayWalletTransaction()
{ {
BOOST_FOREACH(const CMerkleTx& tx, vtxPrev) BOOST_FOREACH(const CMerkleTx& tx, vtxPrev)
{ {
if (!tx.IsCoinBase()) // Important: versions of bitcoin before 0.8.6 had a bug that inserted
// empty transactions into the vtxPrev, which will cause the node to be
// banned when retransmitted, hence the check for !tx.vin.empty()
if (!tx.IsCoinBase() && !tx.vin.empty())
if (tx.GetDepthInMainChain() == 0) if (tx.GetDepthInMainChain() == 0)
RelayTransaction((CTransaction)tx, tx.GetHash()); RelayTransaction((CTransaction)tx, tx.GetHash());
} }

Loading…
Cancel
Save