[verified] fix(wallet): conjunctive receipt verify
Some checks failed
ci / test (pull_request) Failing after 35s
Some checks failed
ci / test (pull_request) Failing after 35s
Require non-empty txid AND amount AND address against one get_transfers row. Signed rcp alone never sets verified=1.
This commit is contained in:
parent
2b42864eba
commit
1a465581c2
3 changed files with 91 additions and 8 deletions
|
|
@ -140,12 +140,11 @@ impl Wallet {
|
|||
}
|
||||
|
||||
pub fn transfers_match(rows: &[TransferRow], txid: &str, amount: &str, address: &str) -> bool {
|
||||
rows.iter().any(|r| {
|
||||
r.txid == txid
|
||||
|| (!address.is_empty()
|
||||
&& r.address == address
|
||||
&& (amount.is_empty() || r.amount == amount))
|
||||
})
|
||||
if txid.is_empty() || amount.is_empty() || address.is_empty() {
|
||||
return false;
|
||||
}
|
||||
rows.iter()
|
||||
.any(|r| r.txid == txid && r.amount == amount && r.address == address)
|
||||
}
|
||||
|
||||
fn parse_http_url(url: &str) -> Result<Endpoint> {
|
||||
|
|
|
|||
Loading…
Reference in a new issue