Do not resurrect staking transactions and lose stake age when no block won
This commit is contained in:
@@ -3138,12 +3138,15 @@ bool static DisconnectTip(CValidationState &state, bool fBare = false) {
|
||||
return false;
|
||||
|
||||
if (!fBare) {
|
||||
// Resurrect mempool transactions from the disconnected block.
|
||||
BOOST_FOREACH(const CTransaction &tx, block.vtx) {
|
||||
// resurrect mempool transactions from the disconnected block.
|
||||
for (int i = 0; i < block.vtx.size(); i++)
|
||||
{
|
||||
// ignore validation errors in resurrected transactions
|
||||
CTransaction &tx = block.vtx[i];
|
||||
list<CTransaction> removed;
|
||||
CValidationState stateDummy;
|
||||
if (tx.IsCoinBase() || !AcceptToMemoryPool(mempool, stateDummy, tx, false, NULL))
|
||||
// don't keep staking transactions
|
||||
if (tx.IsCoinBase() || (block.IsVerusPOSBlock() && (i == (block.vtx.size() - 1))) || !AcceptToMemoryPool(mempool, stateDummy, tx, false, NULL))
|
||||
mempool.remove(tx, removed, true);
|
||||
}
|
||||
if (anchorBeforeDisconnect != anchorAfterDisconnect) {
|
||||
|
||||
Reference in New Issue
Block a user