Merge branch 'main' into Pravdyvy/sparse-merkle-tree-storage-preparation

This commit is contained in:
Oleksandr Pravdyvyi
2025-05-21 08:31:15 +03:00
8 changed files with 50 additions and 375 deletions
+1 -7
View File
@@ -133,13 +133,7 @@ impl NodeChainStore {
serde_json::from_slice::<UTXO>(&decoded_data_curr_acc);
if let Ok(utxo) = decoded_utxo_try {
if &utxo.owner == acc_id {
let input_utxo = UTXOTreeInput {
utxo_id: utxo_id as u64,
tx_id: tx_id as u64,
block_id: block.block_id,
utxo,
};
acc.utxo_tree.insert_item(input_utxo)?;
acc.utxos.insert(utxo.hash, utxo);
}
}
}
+7 -17
View File
@@ -1062,7 +1062,7 @@ impl NodeCore {
let acc = write_guard.acc_map.get_mut(&acc_addr).unwrap();
acc.utxo_tree.get_item(new_utxo_hash)?.unwrap().clone()
acc.utxos.get(&new_utxo_hash).unwrap().clone()
};
new_utxo.log();
@@ -1101,12 +1101,7 @@ impl NodeCore {
.map(|new_utxo_hash| {
let acc = write_guard.acc_map.get_mut(&acc_addr).unwrap();
let new_utxo = acc
.utxo_tree
.get_item(new_utxo_hash)
.unwrap()
.unwrap()
.clone();
let new_utxo = acc.utxos.get(&new_utxo_hash).unwrap().clone();
new_utxo.log();
info!(
@@ -1238,7 +1233,7 @@ impl NodeCore {
let acc = write_guard.acc_map.get_mut(&acc_addr_rec).unwrap();
acc.log();
acc.utxo_tree.get_item(new_utxo_hash)?.unwrap().clone()
acc.utxos.get(&new_utxo_hash).unwrap().clone()
};
new_utxo.log();
info!(
@@ -1278,7 +1273,7 @@ impl NodeCore {
let acc = write_guard.acc_map.get_mut(&acc_addr_rec).unwrap();
acc.log();
acc.utxo_tree.get_item(new_utxo_hash)?.unwrap().clone()
acc.utxos.get(&new_utxo_hash).unwrap().clone()
};
new_utxo.log();
info!(
@@ -1323,7 +1318,7 @@ impl NodeCore {
let acc = write_guard.acc_map.get_mut(&acc_addr_rec).unwrap();
acc.log();
let new_utxo = acc.utxo_tree.get_item(new_utxo_hash)?.unwrap().clone();
let new_utxo = acc.utxos.get(&new_utxo_hash).unwrap().clone();
new_utxo.log();
info!(
@@ -1343,7 +1338,7 @@ impl NodeCore {
let acc = write_guard.acc_map.get_mut(&acc_addr).unwrap();
acc.log();
let new_utxo = acc.utxo_tree.get_item(new_utxo_hash)?.unwrap().clone();
let new_utxo = acc.utxos.get(&new_utxo_hash).unwrap().clone();
new_utxo.log();
info!(
@@ -1556,12 +1551,7 @@ impl NodeCore {
.map(|(acc_addr_rec, new_utxo_hash)| {
let acc = write_guard.acc_map.get_mut(&acc_addr_rec).unwrap();
let new_utxo = acc
.utxo_tree
.get_item(new_utxo_hash)
.unwrap()
.unwrap()
.clone();
let new_utxo = acc.utxos.get(&new_utxo_hash).unwrap().clone();
new_utxo.log();
info!(