Skip to content

Commit

Permalink
Merge pull request #1172 from zancas/fix_is_outgoing_double_count_bug
Browse files Browse the repository at this point in the history
do not include self sent transparent notes in outgoing tx data
  • Loading branch information
Oscar-Pepper authored Jun 3, 2024
2 parents 314d3e9 + e8a0549 commit 3366bc6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
15 changes: 11 additions & 4 deletions libtonode-tests/tests/legacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3232,10 +3232,17 @@ mod slow {
// 5 Shield transparent and sapling to orchard
// # Expected Fees:
// - legacy: 10_000
// - 317: 5_000 for transparent + 10_000 for orchard + 10_000 for sapling == 25_000
from_inputs::shield(&pool_migration_client, &[PoolType::Transparent], None)
.await
.unwrap();
// - 317: disallowed (not *precisely*) BY 317...
from_inputs::shield(
&pool_migration_client,
&[
PoolType::Transparent,
PoolType::Shielded(ShieldedProtocol::Sapling),
],
None,
)
.await
.unwrap();
bump_and_check_pmc!(o: 50_000 s: 0 t: 0);

// 6 self send orchard to orchard
Expand Down
14 changes: 8 additions & 6 deletions zingolib/src/wallet/transaction_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,14 @@ pub mod decrypt_transaction {
.recipient_address()
.map(|raw_taddr| address_from_pubkeyhash(&self.config, raw_taddr))
{
outgoing_metadatas.push(OutgoingTxData {
recipient_address: taddr,
value: u64::from(vout.value),
memo: Memo::Empty,
recipient_ua: None,
});
if !taddrs_set.contains(&taddr) {
outgoing_metadatas.push(OutgoingTxData {
recipient_address: taddr,
value: u64::from(vout.value),
memo: Memo::Empty,
recipient_ua: None,
});
}
}
}
}
Expand Down

0 comments on commit 3366bc6

Please sign in to comment.