fix: validate wallet matches handle before starting listener

This commit is contained in:
Forte11Cuba
2026-03-29 18:29:23 -06:00
parent c92c438efe
commit 438603c97b
+8
View File
@@ -331,6 +331,14 @@ impl Wallet {
mint_url,
} = handle;
// Fail fast if the handle was created for a different wallet
let current_mint = self.mint_url()?;
let current_unit = CurrencyUnit::from_str(&self.unit)
.unwrap_or(CurrencyUnit::Custom(self.unit.clone()));
if mint_url != current_mint || expected_unit != current_unit {
return Err(Error::InvalidInput);
}
if sink
.add(NostrPaymentEvent {
state: NostrPaymentState::Waiting,