nwc: fix bug where private nwc zaps weren't getting tracked properly

It was using the wrapper zap request id instead of the inner id. Fix
this type error by creating a ZapRequestId wrapper that makes sure it
uses the proper request id.
This commit is contained in:
William Casarin
2023-05-14 10:48:44 -07:00
parent e472e559a5
commit b1fee253b4
6 changed files with 80 additions and 21 deletions

View File

@@ -234,7 +234,8 @@ func nwc_error(zapcache: Zaps, evcache: EventCache, resp: FullWalletResponse) {
}
// remove the pending zap if there was an error
remove_zap(reqid: pzap.request.ev.id, zapcache: zapcache, evcache: evcache)
let reqid = ZapRequestId(from_pending: pzap)
remove_zap(reqid: reqid, zapcache: zapcache, evcache: evcache)
return
}
}