Merge branch 'develop' into fix/mixup-config-parsing

This commit is contained in:
Anthony Caccia
2023-07-10 12:23:49 +02:00
3 changed files with 17 additions and 11 deletions

View File

@@ -25,6 +25,8 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
- Added config setting `burnchain.wallet_name` which addresses blank wallets no
longer being created by default in recent bitcoin versions. Fixes issue #3596
- Use the current burnchain tip to lookup UTXOs (Issue #3733)
- The node now gracefully shuts down even if it is in the middle of a handshake with
bitcoind. Fixes issue #3734.

View File

@@ -1939,15 +1939,6 @@ impl StacksChainState {
self.clarity_state.with_marf(f)
}
fn begin_read_only_clarity_tx<'a>(
&'a mut self,
burn_dbconn: &'a dyn BurnStateDB,
index_block: &StacksBlockId,
) -> ClarityReadOnlyConnection<'a> {
self.clarity_state
.read_only_connection(&index_block, &self.state_index, burn_dbconn)
}
/// Run to_do on the state of the Clarity VM at the given chain tip.
/// Returns Some(x: R) if the given parent_tip exists.
/// Returns None if not
@@ -1970,7 +1961,17 @@ impl StacksChainState {
return None;
}
}
let mut conn = self.begin_read_only_clarity_tx(burn_dbconn, parent_tip);
let mut conn = match self.clarity_state.read_only_connection_checked(
parent_tip,
&self.state_index,
burn_dbconn,
) {
Ok(x) => Some(x),
Err(e) => {
warn!("Failed to load read only connection"; "err" => %e);
None
}
}?;
let result = to_do(&mut conn);
Some(result)
}

View File

@@ -1160,6 +1160,9 @@ impl BitcoinRegtestController {
None => LeaderBlockCommitFees::estimated_fees_from_payload(&payload, &self.config),
};
let _ = self.sortdb_mut();
let burn_chain_tip = self.burnchain_db.as_ref()?.get_canonical_chain_tip().ok()?;
let public_key = signer.get_public_key();
let (mut tx, mut utxos) = self.prepare_tx(
epoch_id,
@@ -1167,7 +1170,7 @@ impl BitcoinRegtestController {
estimated_fees.estimated_amount_required(),
utxos_to_include,
utxos_to_exclude,
payload.parent_block_ptr as u64,
burn_chain_tip.block_height,
)?;
// Serialize the payload