mirror of
https://github.com/mimblewimble/grin.git
synced 2025-02-01 17:01:09 +03:00
log loudly if we fail to prepare txs for mining
This commit is contained in:
parent
ba9a362d02
commit
ba25592f15
1 changed files with 8 additions and 4 deletions
|
@ -111,10 +111,14 @@ fn build_block(
|
||||||
// If this fails for *any* reason then fallback to an empty vec of txs.
|
// If this fails for *any* reason then fallback to an empty vec of txs.
|
||||||
// This will allow us to mine an "empty" block if the txpool is in an
|
// This will allow us to mine an "empty" block if the txpool is in an
|
||||||
// invalid (and unexpected) state.
|
// invalid (and unexpected) state.
|
||||||
let txs = tx_pool
|
let txs = match tx_pool.read().prepare_mineable_transactions() {
|
||||||
.read()
|
Ok(txs) => txs,
|
||||||
.prepare_mineable_transactions()
|
Err(e) => {
|
||||||
.unwrap_or(vec![]);
|
error!("build_block: Failed to prepare mineable txs from txpool: {:?}", e);
|
||||||
|
warn!("build_block: Falling back to mining empty block.");
|
||||||
|
vec![]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// build the coinbase and the block itself
|
// build the coinbase and the block itself
|
||||||
let fees = txs.iter().map(|tx| tx.fee()).sum();
|
let fees = txs.iter().map(|tx| tx.fee()).sum();
|
||||||
|
|
Loading…
Reference in a new issue