remove key with empty value from map txs in func NewOrderTransactionByNonce

This commit is contained in:
Daniel Liu 2024-01-24 13:37:38 +08:00
parent 559bb4f7f5
commit e097f2b0df

View file

@ -305,6 +305,7 @@ func NewOrderTransactionByNonce(signer OrderSigner, txs map[common.Address]Order
heads := make(OrderTxByNonce, 0, len(txs))
for from, accTxs := range txs {
if len(accTxs) == 0 {
delete(txs, from)
continue
}
heads = append(heads, accTxs[0])