Skip to content

Commit

Permalink
Merge pull request zingolabs#498 from AloeareV/fix_reorg_buffer_offset
Browse files Browse the repository at this point in the history
Fix reorg buffer offset
  • Loading branch information
juanky201271 authored Sep 20, 2023
2 parents c439789 + 87e226a commit 823383c
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions zingolib/src/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ use self::{
message::Message,
transactions::TransactionMetadataSet,
};
use zingoconfig::{ZingoConfig, REORG_BUFFER_OFFSET};
use zingoconfig::ZingoConfig;

pub mod data;
pub mod keys;
Expand Down Expand Up @@ -476,7 +476,7 @@ impl LightWallet {
>,
) -> Result<Anchor, String> {
Ok(orchard::Anchor::from(
tree.root_at_checkpoint(REORG_BUFFER_OFFSET as usize)
tree.root_at_checkpoint(self.transaction_context.config.reorg_buffer_offset as usize)
.map_err(|e| format!("failed to get orchard anchor: {e}"))?,
))
}
Expand Down Expand Up @@ -1104,7 +1104,10 @@ impl LightWallet {
selected.note.clone(),
witness_trees
.witness_tree_sapling
.witness(selected.witnessed_position, REORG_BUFFER_OFFSET as usize)
.witness(
selected.witnessed_position,
self.transaction_context.config.reorg_buffer_offset as usize,
)
.map_err(|e| format!("failed to compute sapling witness: {e}"))?,
) {
let e = format!("Error adding note: {:?}", e);
Expand All @@ -1121,7 +1124,10 @@ impl LightWallet {
orchard::tree::MerklePath::from(
witness_trees
.witness_tree_orchard
.witness(selected.witnessed_position, REORG_BUFFER_OFFSET as usize)
.witness(
selected.witnessed_position,
self.transaction_context.config.reorg_buffer_offset as usize,
)
.map_err(|e| format!("failed to compute orchard witness: {e}"))?,
),
) {
Expand Down

0 comments on commit 823383c

Please sign in to comment.