Skip to content

Commit 508a35c

Browse files
committed
fix docstring and check for wallet trait on tx
1 parent 26040ec commit 508a35c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

client/webserver/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ func (s *WebServer) apiNewDepositAddress(w http.ResponseWriter, r *http.Request)
619619
}, s.indent)
620620
}
621621

622-
// apiAddressUsed gets a new deposit address from a wallet.
622+
// apiAddressUsed checks whether an address has been used.
623623
func (s *WebServer) apiAddressUsed(w http.ResponseWriter, r *http.Request) {
624624
form := &struct {
625625
AssetID *uint32 `json:"assetID"`

client/webserver/site/src/js/forms.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2041,6 +2041,8 @@ export class DepositAddress {
20412041

20422042
handleTx (assetID: number, tx: WalletTransaction) {
20432043
if (assetID !== this.assetID) return
2044+
const wallet = app().walletMap[assetID]
2045+
if ((wallet.traits & traitNewAddresser) === 0) return
20442046
const { page, addr } = this
20452047
if (tx.amount > 0 && tx.recipient === addr) Doc.show(page.addrUsed)
20462048
}

0 commit comments

Comments
 (0)