Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Priority: P1 — stuck-proof hygiene: reclaim machinery exists but is never invoked by the daemon.

Open
#500 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
go
Domain
backend, payments

Research direction

Start in src/merchant/merchant.go and read the wallet references in gonuts wallet/wallet.go for ReclaimUnspentProofs() and GetPendingMeltQuotes(); first verify the wallet locking and existing health-loop behavior. Add boot-time and periodic reconciliation with the specified reseller-ownership and error-handling safeguards. Done means interrupted-melt proofs recover after restart, spent-but-pending proofs are surfaced once, and the unit, integration, and failure-injection tests pass.

Written by the indexing model from the issue text.

Description

Priority: P1 — stuck-proof hygiene: reclaim machinery exists but is never invoked by the daemon.

Problem

gonuts has ReclaimUnspentProofs() (NUT-07 checkstate on pending proofs, reclaim unspent ones via swap) and GetPendingMeltQuotes(), but nothing in the TollGate daemon ever calls them — they're reachable only from the nutw CLI. Any proof that enters pending via a failed send, an ambiguous melt, or a reseller interrupted hand-off stays reserved indefinitely: invisible in balance, consuming wallet state, until a human runs a CLI.

Why it matters

Reserved-forever proofs are indistinguishable from lost funds to an operator and skew payout math. Every ambiguous-outcome path (G01 melt, reseller tokens-to-recover, clientd rejections #423) funnels into this state. Proactive reconciliation is the difference between self-healing and a support ticket.

Current behavior (source refs)

  • gonuts wallet/wallet.go:2196-2262 — ReclaimUnspentProofs (checks state, swaps unspent back), :2258-2276 GetPendingMeltQuotes.
  • TollGate: no call sites (grep ReclaimUnspent src/ → only CLI in gonuts cmd).
  • Related behaviors that interact: Melt's "leave proofs pending on error" (wallet.go:1114-1117), Send's AddPendingProofs (:440-472) with reclaim only via CLI.

Desired invariant

No proof remains in a pending/reserved state longer than a bounded interval without a reconciliation attempt; pending proofs whose mint-side state is Unspent return to spendable automatically; spent-but-still-pending ones are surfaced (balance discrepancy) not silently held.

Proposed scope

  1. Boot-time reconciliation: after wallet load, run ReclaimUnspentProofs + resolve GetPendingMeltQuotes (Paid → finalize + counter fix per G01; Unpaid → release proofs; Pending → schedule re-check).
  2. Periodic sweep (piggyback the mint-health proactive loop; interval ≈ minutes, only when pending set is non-empty — flash-cheap: the pending bucket read is in-memory).
  3. Observability: log + status surface for reclaimed amount and irreconcilable (spent-but-pending) proofs.
  4. Reseller interplay: ensure the reseller "tokens-to-recover" path is not fighting the sweeper (coordinate ownership: sweeper must skip proofs owned by an in-flight reseller transaction — add an owner marker or time threshold).

Areas / files

src/merchant/merchant.go (startup + hook into health loop), gonuts API already sufficient (verify ReclaimUnspentProofs is goroutine-safe under the wallet mutex — it calls createSwapRequest itself; audit locking).

Acceptance criteria

  • Fault test: force proofs into pending (interrupted melt), restart daemon → proofs reclaimed automatically, balance restored, log line present.
  • Spent-but-pending (mint says spent) → surfaced once, not looped.

Required tests

  • Unit: sweep trigger conditions; reseller-ownership skip.
  • Integration: interrupted-melt lane (with G01 proxy) → auto-recovery.

Failure-injection tests

  • Mint unreachable during sweep → retry next interval, no crash-loop.
  • Sweep racing a live payment → mutex audit proof (−race).

Compatibility

None.

Dependencies

G01 (melt quote resolution semantics) recommended first.

Out of scope

  • Changing when proofs enter pending (that's each flow's own fix).
Dominant language
Go
Stars
12
Forks
14
Avg merge
1d 6h
Merged PRs (30d)
217

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OpenTollGate/tollgate-module-basic-go

All issues in OpenTollGate/tollgate-module-basic-go

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.