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:
Antioch Peverell
2018-08-28 20:00:25 +01:00
committed by GitHub
parent 3dacc6a397
commit c334c557aa
10 changed files with 120 additions and 135 deletions
+3 -3
View File
@@ -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