mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-03 17:44:29 +00:00
clean
This commit is contained in:
parent
917bdc029c
commit
d474087511
@ -504,18 +504,8 @@ func (b *ByNonce) has(mt *metaTx) bool {
|
|||||||
found := b.tree.Get(&sortByNonce{mt})
|
found := b.tree.Get(&sortByNonce{mt})
|
||||||
return found != nil
|
return found != nil
|
||||||
}
|
}
|
||||||
func (b *ByNonce) delete(mt *metaTx) {
|
func (b *ByNonce) delete(mt *metaTx) { b.tree.Delete(&sortByNonce{mt}) }
|
||||||
deleted := b.tree.Delete(&sortByNonce{mt})
|
|
||||||
if ASSERT {
|
|
||||||
if deleted != nil && deleted.(*sortByNonce).metaTx.Tx.idHash != mt.Tx.idHash {
|
|
||||||
panic(1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
func (b *ByNonce) replaceOrInsert(mt *metaTx) *metaTx {
|
func (b *ByNonce) replaceOrInsert(mt *metaTx) *metaTx {
|
||||||
if ASSERT && (mt == nil || mt.Tx == nil || mt.Tx.senderID == 0) {
|
|
||||||
panic("must never happen")
|
|
||||||
}
|
|
||||||
it := b.tree.ReplaceOrInsert(&sortByNonce{mt})
|
it := b.tree.ReplaceOrInsert(&sortByNonce{mt})
|
||||||
if it != nil {
|
if it != nil {
|
||||||
return it.(*sortByNonce).metaTx
|
return it.(*sortByNonce).metaTx
|
||||||
|
Loading…
Reference in New Issue
Block a user