mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-30 10:25:12 +02:00
[bugfix] update lockpoints correctly during reorg
During a reorg, we re-check timelocks on all mempool entries using
CheckSequenceLocks(useExistingLockPoints=false) and remove any
now-invalid entries. CheckSequenceLocks() also mutates the LockPoints
passed in, and we update valid entries' LockPoints using
update_lock_points. Thus, update_lock_points(lp) needs to be called
right after CheckSequenceLocks(lp), otherwise we lose the data in lp.
commit bedf246 introduced a bug by separating those two loops.
This commit is contained in:
@@ -378,6 +378,8 @@ void CChainState::MaybeUpdateMempoolForReorg(
|
||||
}
|
||||
}
|
||||
}
|
||||
// CheckSequenceLocks updates lp. Update the mempool entry LockPoints.
|
||||
if (!validLP) m_mempool->mapTx.modify(it, update_lock_points(lp));
|
||||
return should_remove;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user