Simplify tx.validate() and transaction::aggregate() (#1436)
* simplify tx validation and aggregation we *only* need to account for reward when building a block from txs * rustfmt * cleanup and tests passing * rustfmt * better comments in with_reward() * fix wallet tests
This commit is contained in:
+3
-3
@@ -86,7 +86,7 @@ impl Pool {
|
||||
.into_iter()
|
||||
.filter_map(|mut bucket| {
|
||||
bucket.truncate(MAX_TX_CHAIN);
|
||||
transaction::aggregate(bucket, None).ok()
|
||||
transaction::aggregate(bucket).ok()
|
||||
})
|
||||
.collect();
|
||||
|
||||
@@ -118,7 +118,7 @@ impl Pool {
|
||||
return Ok(None);
|
||||
}
|
||||
|
||||
let tx = transaction::aggregate(txs, None)?;
|
||||
let tx = transaction::aggregate(txs)?;
|
||||
Ok(Some(tx))
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ impl Pool {
|
||||
// Create a single aggregated tx from the existing pool txs and the
|
||||
// new entry
|
||||
txs.push(entry.tx.clone());
|
||||
transaction::aggregate(txs, None)?
|
||||
transaction::aggregate(txs)?
|
||||
};
|
||||
|
||||
// Validate aggregated tx against a known chain state (via txhashset
|
||||
|
||||
@@ -100,7 +100,7 @@ impl TransactionPool {
|
||||
self.is_acceptable(&tx)?;
|
||||
|
||||
// Make sure the transaction is valid before anything else.
|
||||
tx.validate(false).map_err(|e| PoolError::InvalidTx(e))?;
|
||||
tx.validate().map_err(|e| PoolError::InvalidTx(e))?;
|
||||
|
||||
// Check the tx lock_time is valid based on current chain state.
|
||||
self.blockchain.verify_tx_lock_height(&tx)?;
|
||||
|
||||
Reference in New Issue
Block a user