Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip UpdateAfterDisconnectBlock for pos blocks #1441

Merged
merged 2 commits into from
Jan 30, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/legacy_mempool.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,9 @@ func (mp *DeSoMempool) resetPool(newPool *DeSoMempool) {
// TODO: This is fairly inefficient but the story is the same as for
// UpdateAfterDisconnectBlock.
func (mp *DeSoMempool) UpdateAfterConnectBlock(blk *MsgDeSoBlock) (_txnsAddedToMempool []*MempoolTx) {
if mp.bc.params.IsPoSBlockHeight(blk.Header.Height) {
return
}
// Protect concurrent access.
mp.mtx.Lock()
defer mp.mtx.Unlock()
Expand Down Expand Up @@ -501,6 +504,9 @@ func (mp *DeSoMempool) UpdateAfterConnectBlock(blk *MsgDeSoBlock) (_txnsAddedToM
// But until then doing it this way significantly reduces complexity and should hold up
// for a while.
func (mp *DeSoMempool) UpdateAfterDisconnectBlock(blk *MsgDeSoBlock) {
if mp.bc.params.IsPoSBlockHeight(blk.Header.Height) {
return
}
// Protect concurrent access.
mp.mtx.Lock()
defer mp.mtx.Unlock()
Expand Down