Skip to content

Commit 3366bc6

Browse files
authored
Merge pull request #1172 from zancas/fix_is_outgoing_double_count_bug
do not include self sent transparent notes in outgoing tx data
2 parents 314d3e9 + e8a0549 commit 3366bc6

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

libtonode-tests/tests/legacy.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3232,10 +3232,17 @@ mod slow {
32323232
// 5 Shield transparent and sapling to orchard
32333233
// # Expected Fees:
32343234
// - legacy: 10_000
3235-
// - 317: 5_000 for transparent + 10_000 for orchard + 10_000 for sapling == 25_000
3236-
from_inputs::shield(&pool_migration_client, &[PoolType::Transparent], None)
3237-
.await
3238-
.unwrap();
3235+
// - 317: disallowed (not *precisely*) BY 317...
3236+
from_inputs::shield(
3237+
&pool_migration_client,
3238+
&[
3239+
PoolType::Transparent,
3240+
PoolType::Shielded(ShieldedProtocol::Sapling),
3241+
],
3242+
None,
3243+
)
3244+
.await
3245+
.unwrap();
32393246
bump_and_check_pmc!(o: 50_000 s: 0 t: 0);
32403247

32413248
// 6 self send orchard to orchard

zingolib/src/wallet/transaction_context.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,14 @@ pub mod decrypt_transaction {
124124
.recipient_address()
125125
.map(|raw_taddr| address_from_pubkeyhash(&self.config, raw_taddr))
126126
{
127-
outgoing_metadatas.push(OutgoingTxData {
128-
recipient_address: taddr,
129-
value: u64::from(vout.value),
130-
memo: Memo::Empty,
131-
recipient_ua: None,
132-
});
127+
if !taddrs_set.contains(&taddr) {
128+
outgoing_metadatas.push(OutgoingTxData {
129+
recipient_address: taddr,
130+
value: u64::from(vout.value),
131+
memo: Memo::Empty,
132+
recipient_ua: None,
133+
});
134+
}
133135
}
134136
}
135137
}

0 commit comments

Comments
 (0)