aboutsummaryrefslogtreecommitdiffstats
path: root/src/ark
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-30 22:42:53 -0700
committerAdam Soltys <[email protected]>2026-08-30 22:42:53 -0700
commit280bbfd09f9bc7c948f77d4e362cc3b32d4fcfc1 (patch)
treeb6e03a5a44cf8ea637657db5223e8bdb115c4df5 /src/ark
parentbfe6ee7f93d294e430718a91c96aef815ee6935a (diff)
downloadcoinosv3-280bbfd09f9bc7c948f77d4e362cc3b32d4fcfc1.tar.gz
coinosv3-280bbfd09f9bc7c948f77d4e362cc3b32d4fcfc1.zip
One spend, one row: send and lightning-pay movements now record which coins they consumed, spend actions sync as slivers (id + net amount + inputIds), and the reconcile exclusion generalizes from renewals to ANY accounted-for coin — a laptop send used to paint the phone's history twice, once as the real Sent and once as a red 'Spent on another device' at full input magnitude. The red row survives only for spends nothing anywhere explains
Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MrkLsNScXe9b6BviUSdmMr
Diffstat (limited to 'src/ark')
-rw-r--r--src/ark/manager.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ark/manager.js b/src/ark/manager.js
index e60d2f3..492906d 100644
--- a/src/ark/manager.js
+++ b/src/ark/manager.js
@@ -755,6 +755,9 @@ export class ArkManager {
this._movement({
type: 'send', amountSat: action.amountSat, status: 'complete',
to: action.destAddress, vtxoId: decodeVtxo(hex.decode(destList()[0])).id,
+ // which coins this spend consumed — synced, so other devices can
+ // skip the "spent on another device" row these inputs would earn
+ inputIds: (action.parts || []).map((p2) => p2.inputId).filter(Boolean),
});
this._save();
}
@@ -1055,6 +1058,7 @@ export class ArkManager {
type: 'ln-send', amountSat: action.amountSat, status: 'complete',
detail: action.feeSat ? `fee ${action.feeSat} sat` : undefined,
invoice: action.invoice, preimage: preimageHex, paymentHash: action.paymentHash,
+ inputIds: (action.parts || []).map((p2) => p2.inputId).concat(action.inputId ? [action.inputId] : []).filter(Boolean),
});
this._save();
}