Added --tx-queue-no-early-reject flag to disable early tx queue rejects (#9143)

* Added --tx-queue-no-early-reject flag to disable early tx queue rejects because of low gas price

* Fixed failing tests, clarified comments and simplified no_early_reject field name.

* Added test case for the --tx-queue-no-early-reject flag
This commit is contained in:
Peter Pratscher
2018-07-24 15:04:48 +02:00
committed by Andronik Ordian
parent 4848c384cd
commit 1b1941a896
9 changed files with 73 additions and 5 deletions

View File

@@ -243,11 +243,15 @@ impl TransactionQueue {
let options = self.options.read().clone();
let transaction_to_replace = {
let pool = self.pool.read();
if pool.is_full() {
pool.worst_transaction().map(|worst| (pool.scoring().clone(), worst))
} else {
if options.no_early_reject {
None
} else {
let pool = self.pool.read();
if pool.is_full() {
pool.worst_transaction().map(|worst| (pool.scoring().clone(), worst))
} else {
None
}
}
};