general: snapshot

This commit is contained in:
k
2024-07-12 08:35:41 +02:00
parent 350c835873
commit 35fd5054aa
51 changed files with 2831 additions and 3251 deletions

View File

@@ -12,6 +12,7 @@ use crate::{
Databases, TxidToTxData, TxoutIndexToAddressIndex, TxoutIndexToAmount,
},
datasets::{AllDatasets, InsertData},
log,
states::{
AddressCohortsInputStates, AddressCohortsOutputStates, AddressCohortsRealizedStates,
States, UTXOCohortsOneShotStates, UTXOCohortsSentStates,
@@ -53,6 +54,8 @@ pub fn parse(
timestamp,
}: ParseData,
) {
// log(&format!("{height}"));
// If false, expect that the code is flawless
// or create a 0 value txid database
let enable_check_if_txout_value_is_zero_in_db: bool = true;
@@ -539,10 +542,6 @@ pub fn parse(
}
});
// if !txin_ordered_tx_datas.is_empty() {
// panic!("txin_ordered_tx_indexes should've been fully consumed");
// }
let mut utxo_cohorts_sent_states = UTXOCohortsSentStates::default();
let mut utxo_cohorts_one_shot_states = UTXOCohortsOneShotStates::default();
// let mut utxo_cohorts_received_states = UTXOCohortsReceivedStates::default();

View File

@@ -61,6 +61,8 @@ impl UTXOCohortDurableStates {
dbg!(
report,
"cents_to_amount decrement failed",
rounded_price,
price,
amount,
utxo_count
);

View File

@@ -129,7 +129,10 @@ impl UTXOCohortsDurableStates {
self.initial_filtered_apply(&days_old, &year, |state| {
state
.decrement(amount, utxo_count, block_data.price)
.unwrap();
.unwrap_or_else(|report| {
dbg!(report, block_data, sent_data, previous_last_block_data);
panic!()
});
})
}