Skip to content

Commit 1a48c9b

Browse files
Abandon orphaned coinstakes on startup
1 parent 1a66d17 commit 1a48c9b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/wallet/wallet.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1884,8 +1884,12 @@ void CWallet::ReacceptWalletTransactions()
18841884

18851885
int nDepth = wtx.GetDepthInMainChain();
18861886

1887-
if (!wtx.IsCoinBase() && !wtx.IsCoinStake() && (nDepth == 0 && !wtx.isAbandoned())) {
1888-
mapSorted.insert(std::make_pair(wtx.nOrderPos, &wtx));
1887+
if (nDepth == 0 && !wtx.isAbandoned()) {
1888+
if (wtx.IsCoinBase() || wtx.IsCoinStake()) {
1889+
WalletLogPrintf("Abandoning orphaned coinbase/coinstake %s\n", wtxid.ToString());
1890+
AbandonTransaction(wtxid);
1891+
} else
1892+
mapSorted.insert(std::make_pair(wtx.nOrderPos, &wtx));
18891893
}
18901894
}
18911895

0 commit comments

Comments
 (0)