cmd/faucet: clear reqs list when reorg to lower nonce (#1458)
This commit is contained in:
parent
b4f1cdffd5
commit
e4b6ab9ba3
@ -667,6 +667,9 @@ func (f *faucet) refresh(head *types.Header) error {
|
||||
f.lock.Lock()
|
||||
f.head, f.balance = head, balance
|
||||
f.price, f.nonce = price, nonce
|
||||
if len(f.reqs) > 0 && f.reqs[0].Tx.Nonce() > f.nonce {
|
||||
f.reqs = f.reqs[:0]
|
||||
}
|
||||
for len(f.reqs) > 0 && f.reqs[0].Tx.Nonce() < f.nonce {
|
||||
f.reqs = f.reqs[1:]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user