staticaddr: track unconfirmed deposits

Surface static-address deposits as soon as they appear in the wallet instead
of waiting for the old six-confirmation readiness threshold.

Reconcile the wallet view on startup, on each block, and on the polling ticker
so mempool deposits are created immediately. Backfill the first confirmation
height once those outputs confirm, protect unconfirmed deposits from expiry,
and mark vanished unconfirmed outpoints as Replaced so RBFed-away deposits stop
showing up in RPCs.

Expose the new state through static-address RPCs by deriving availability and
summary totals from stored deposit state, reporting sensible expiry data for
unconfirmed outputs, and hiding Replaced records from normal listings.
This commit is contained in:
Slyghtning 2026-04-27 11:23:06 +02:00
parent 5818b986ae
commit 3df71f9a19
No known key found for this signature in database
GPG key ID: F82D456EA023C9BF
13 changed files with 1265 additions and 117 deletions

View file

@ -16,7 +16,7 @@ CREATE TABLE IF NOT EXISTS deposits (
amount BIGINT NOT NULL,
-- confirmation_height is the absolute height at which the deposit was
-- confirmed.
-- confirmed. A value of 0 means the deposit is still unconfirmed.
confirmation_height BIGINT NOT NULL,
-- timeout_sweep_pk_script is the public key script that will be used to
@ -45,4 +45,4 @@ CREATE TABLE IF NOT EXISTS deposit_updates (
-- update_timestamp is the timestamp of the update.
update_timestamp TIMESTAMP NOT NULL
);
);