Remove conflicting TXs before adding SpendBundle to Mempool in add_spend_bundle (#14292)

This commit is contained in:
Adam Kelly 2023-01-06 10:00:54 -08:00 committed by GitHub
parent 8e764eb05e
commit 00480ccd1b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -348,8 +348,8 @@ class MempoolManager:
if err is None: if err is None:
# No error, immediately add to mempool, after removing conflicting TXs. # No error, immediately add to mempool, after removing conflicting TXs.
assert item is not None assert item is not None
self.mempool.add_to_pool(item)
self.mempool.remove_from_pool(remove_items, MempoolRemoveReason.CONFLICT) self.mempool.remove_from_pool(remove_items, MempoolRemoveReason.CONFLICT)
self.mempool.add_to_pool(item)
return item.cost, MempoolInclusionStatus.SUCCESS, None return item.cost, MempoolInclusionStatus.SUCCESS, None
elif item is not None: elif item is not None:
# There is an error, but we still returned a mempool item, this means we should add to the pending pool. # There is an error, but we still returned a mempool item, this means we should add to the pending pool.