@@ -1448,29 +1448,13 @@ pub fn retrieve_satoshi_point_using_lazy_storage(
1448
1448
if index == tx_cursor. 1 {
1449
1449
break ;
1450
1450
}
1451
- // ctx.try_log(|logger| {
1452
- // slog::info!(logger, "Adding {} from output #{}", output_value, index)
1453
- // });
1454
1451
sats_out += output_value;
1455
1452
}
1456
1453
sats_out += ordinal_offset;
1457
- // ctx.try_log(|logger| {
1458
- // slog::info!(
1459
- // logger,
1460
- // "Adding offset {ordinal_offset} to sats_out {sats_out}"
1461
- // )
1462
- // });
1463
1454
1464
1455
let mut sats_in = 0 ;
1465
1456
for input in tx. inputs . iter ( ) {
1466
1457
sats_in += input. txin_value ;
1467
- // ctx.try_log(|logger| {
1468
- // slog::info!(
1469
- // logger,
1470
- // "Adding txin_value {txin_value} to sats_in {sats_in} (txin: {})",
1471
- // hex::encode(&txin)
1472
- // )
1473
- // });
1474
1458
1475
1459
if sats_out < sats_in {
1476
1460
ordinal_offset = sats_out - ( sats_in - input. txin_value ) ;
@@ -1600,9 +1584,12 @@ pub fn retrieve_satoshi_point_using_lazy_storage(
1600
1584
ordinal_offset = sats_out - ( sats_in - input. txin_value ) ;
1601
1585
ordinal_block_number = input. block_height ;
1602
1586
1603
- // ctx.try_log(|logger| slog::info!(logger, "Block {ordinal_block_number} / Tx {} / [in:{sats_in}, out:{sats_out}]: {block_height} -> {ordinal_block_number}:{ordinal_offset} -> {}:{vout}",
1604
- // hex::encode(&txid_n),
1605
- // hex::encode(&txin)));
1587
+ ctx. try_log ( |logger| slog:: info!( logger, "Block {ordinal_block_number} / Tx {} / [in:{sats_in}, out:{sats_out}]: {} -> {ordinal_block_number}:{ordinal_offset} -> {}:{}" ,
1588
+ hex:: encode( & lazy_tx. txid) ,
1589
+ input. block_height,
1590
+ hex:: encode( & input. txin) ,
1591
+ input. vout,
1592
+ ) ) ;
1606
1593
tx_cursor = ( input. txin . clone ( ) , input. vout as usize ) ;
1607
1594
break ;
1608
1595
}
@@ -1755,16 +1742,19 @@ impl LazyBlock {
1755
1742
& self ,
1756
1743
searched_txid : & [ u8 ] ,
1757
1744
) -> Option < LazyBlockTransaction > {
1745
+ // println!("{:?}", hex::encode(searched_txid));
1758
1746
let mut entry = None ;
1759
1747
let mut cursor = Cursor :: new ( & self . bytes ) ;
1760
1748
let mut cumulated_offset = 0 ;
1761
1749
let mut i = 0 ;
1762
1750
while entry. is_none ( ) {
1763
1751
let pos = self . get_transactions_data_pos ( ) + cumulated_offset;
1764
1752
let ( inputs_len, outputs_len, size) = self . get_transaction_format ( i) ;
1753
+ // println!("{inputs_len} / {outputs_len} / {size}");
1765
1754
cursor. set_position ( pos as u64 ) ;
1766
1755
let mut txid = [ 0u8 ; 8 ] ;
1767
1756
let _ = cursor. read_exact ( & mut txid) ;
1757
+ // println!("-> {}", hex::encode(txid));
1768
1758
if searched_txid. eq ( & txid) {
1769
1759
entry = Some ( self . get_lazy_transaction_at_pos (
1770
1760
& mut cursor,
@@ -1813,6 +1803,7 @@ impl<'a> Iterator for LazyBlockTransactionIterator<'a> {
1813
1803
}
1814
1804
let pos = self . lazy_block . get_transactions_data_pos ( ) + self . cumulated_offset ;
1815
1805
let ( inputs_len, outputs_len, size) = self . lazy_block . get_transaction_format ( self . tx_index ) ;
1806
+ // println!("{inputs_len} / {outputs_len} / {size}");
1816
1807
let mut cursor = Cursor :: new ( & self . lazy_block . bytes ) ;
1817
1808
cursor. set_position ( pos as u64 ) ;
1818
1809
let mut txid = [ 0u8 ; 8 ] ;
0 commit comments