[WIP] txpool (tx validation) using block sums for full validation (#1567)
tx validation (txpool) rework/simplify
This commit is contained in:
@@ -109,7 +109,12 @@ fn build_block(
|
||||
let difficulty = consensus::next_difficulty(diff_iter).unwrap();
|
||||
|
||||
// extract current transaction from the pool
|
||||
let txs = tx_pool.read().unwrap().prepare_mineable_transactions();
|
||||
// TODO - we have a lot of unwrap() going on in this fn...
|
||||
let txs = tx_pool
|
||||
.read()
|
||||
.unwrap()
|
||||
.prepare_mineable_transactions()
|
||||
.unwrap();
|
||||
|
||||
// build the coinbase and the block itself
|
||||
let fees = txs.iter().map(|tx| tx.fee()).sum();
|
||||
@@ -121,14 +126,7 @@ fn build_block(
|
||||
};
|
||||
|
||||
let (output, kernel, block_fees) = get_coinbase(wallet_listener_url, block_fees)?;
|
||||
let mut b = core::Block::with_reward(
|
||||
&head,
|
||||
txs,
|
||||
output,
|
||||
kernel,
|
||||
difficulty.clone(),
|
||||
verifier_cache.clone(),
|
||||
)?;
|
||||
let mut b = core::Block::with_reward(&head, txs, output, kernel, difficulty.clone())?;
|
||||
|
||||
// making sure we're not spending time mining a useless block
|
||||
b.validate(
|
||||
|
||||
Reference in New Issue
Block a user