Skip to content

Commit 80ca273

Browse files
committed
Merge pull request #3357
4ef92a9 Refuse to retransmit transactions without vins (Wladimir J. van der Laan)
2 parents 00cfc9f + 4ef92a9 commit 80ca273

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/wallet.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,10 @@ void CWalletTx::RelayWalletTransaction()
895895
{
896896
BOOST_FOREACH(const CMerkleTx& tx, vtxPrev)
897897
{
898-
if (!tx.IsCoinBase())
898+
// Important: versions of bitcoin before 0.8.6 had a bug that inserted
899+
// empty transactions into the vtxPrev, which will cause the node to be
900+
// banned when retransmitted, hence the check for !tx.vin.empty()
901+
if (!tx.IsCoinBase() && !tx.vin.empty())
899902
if (tx.GetDepthInMainChain() == 0)
900903
RelayTransaction((CTransaction)tx, tx.GetHash());
901904
}

0 commit comments

Comments
 (0)