Removing assertion and just comparing fees
This commit is contained in:
parent
8915974cf0
commit
c13afcf404
@ -387,8 +387,9 @@ impl TransactionQueue {
|
|||||||
by_hash.insert(hash.clone(), tx);
|
by_hash.insert(hash.clone(), tx);
|
||||||
if let Some(old) = set.insert(address, nonce, order.clone()) {
|
if let Some(old) = set.insert(address, nonce, order.clone()) {
|
||||||
// There was already transaction in queue. Let's check which one should stay
|
// There was already transaction in queue. Let's check which one should stay
|
||||||
if old.cmp(&order) == Ordering::Greater {
|
let old_fee = old.gas_price;
|
||||||
assert!(old.nonce_height == order.nonce_height, "Both transactions should have the same height.");
|
let new_fee = order.gas_price;
|
||||||
|
if old_fee.cmp(&new_fee) == Ordering::Greater {
|
||||||
// Put back old transaction since it has greater priority (higher gas_price)
|
// Put back old transaction since it has greater priority (higher gas_price)
|
||||||
set.insert(address, nonce, old);
|
set.insert(address, nonce, old);
|
||||||
by_hash.remove(&hash);
|
by_hash.remove(&hash);
|
||||||
|
Loading…
Reference in New Issue
Block a user