Skip to content

Commit

Permalink
fix docstring and check for wallet trait on tx
Browse files Browse the repository at this point in the history
  • Loading branch information
buck54321 committed Feb 3, 2024
1 parent e18fc2b commit 7d7ffb0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/webserver/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ func (s *WebServer) apiNewDepositAddress(w http.ResponseWriter, r *http.Request)
}, s.indent)
}

// apiAddressUsed gets a new deposit address from a wallet.
// apiAddressUsed checks whether an address has been used.
func (s *WebServer) apiAddressUsed(w http.ResponseWriter, r *http.Request) {
form := &struct {
AssetID *uint32 `json:"assetID"`
Expand Down
2 changes: 1 addition & 1 deletion client/webserver/live_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2115,7 +2115,7 @@ func TestServer(t *testing.T) {

s, err := New(&Config{
Core: tCore,
Addr: "127.0.0.1:54321",
Addr: "127.0.0.3:54321",
Logger: logger,
NoEmbed: true, // use files on disk, and reload on each page load
HttpProf: true,
Expand Down
2 changes: 2 additions & 0 deletions client/webserver/site/src/js/forms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1992,6 +1992,8 @@ export class DepositAddress {

handleTx (assetID: number, tx: WalletTransaction) {
if (assetID !== this.assetID) return
const wallet = app().walletMap[assetID]
if ((wallet.traits & traitNewAddresser) === 0) return
const { page, addr } = this
if (tx.amount > 0 && tx.recipient === addr) Doc.show(page.addrUsed)
}
Expand Down

0 comments on commit 7d7ffb0

Please sign in to comment.