Commit 26c621b6 authored by mrekucci's avatar mrekucci Committed by GitHub

fix: turn on postage usable flag only when postage stamp exists (#2390)

parent d796d03f
......@@ -151,7 +151,7 @@ func (s *Service) postageGetStampsHandler(w http.ResponseWriter, _ *http.Request
resp.Stamps = append(resp.Stamps, postageStampResponse{
BatchID: v.ID(),
Utilization: v.Utilization(),
Usable: s.post.IssuerUsable(v),
Usable: exists && s.post.IssuerUsable(v),
Label: v.Label(),
Depth: v.Depth(),
Amount: bigint.Wrap(v.Amount()),
......@@ -249,7 +249,7 @@ func (s *Service) postageGetStampHandler(w http.ResponseWriter, r *http.Request)
if issuer != nil {
resp.Utilization = issuer.Utilization()
resp.Usable = s.post.IssuerUsable(issuer)
resp.Usable = exists && s.post.IssuerUsable(issuer)
resp.Label = issuer.Label()
resp.Depth = issuer.Depth()
resp.Amount = bigint.Wrap(issuer.Amount())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment