diff --git a/features/utxo-list-progressive-loading.md b/features/utxo-list-progressive-loading.md index 7bbd3f5..cc95c4a 100644 --- a/features/utxo-list-progressive-loading.md +++ b/features/utxo-list-progressive-loading.md @@ -41,7 +41,9 @@ Raccourcir le chargement de la page [Liste des UTXO](https://dashboard.certifica ### Compatibilité - Format 7 champs (nouveau) et 6 champs (ancien avec `address`) gérés par `parseUtxoLine`. +- Catégories fichier : `bloc_rewards`, `ancrages`, `changes` (et `anchor`/`change`/`fee` si présents). Le parser accepte les deux formes pour ancrages/changes. - `actualiser` recharge depuis le fichier (même flux que le chargement initial). +- **Frais** : la section « Frais » reste vide en chargement fichier (données issues du RPC / OP_RETURN, non stockées dans `utxo_list.txt`). ## Modalités de déploiement diff --git a/fixKnowledge/utxo-list-file-category-mismatch.md b/fixKnowledge/utxo-list-file-category-mismatch.md new file mode 100644 index 0000000..00902da --- /dev/null +++ b/fixKnowledge/utxo-list-file-category-mismatch.md @@ -0,0 +1,37 @@ +# UTXO-list : Ancrages et Changes vides avec chargement fichier + +**Auteur** : Équipe 4NK +**Date** : 2026-01-26 +**Version** : 1.0 + +## Problème + +Sur [Liste des UTXO](https://dashboard.certificator.4nkweb.com/utxo-list), en chargement depuis le fichier `utxo_list.txt` : + +- **Ancrages** : Nombre 0, montant 0 +- **Changes** : Nombre 0, montant 0 +- **Frais** : Nombre 0 + +Seule la section « Bloc Rewards » affichait des données. + +## Cause racine + +Le fichier `utxo_list.txt` utilise les catégories **`ancrages`** et **`changes`** (comme dans `bitcoin-rpc.js`), alors que le parser client (`parseUtxoLine` dans `utxo-list.html`) n’acceptait que **`anchor`** et **`change`**. Les lignes ancrages/changes étaient donc rejetées et n’alimentaient pas les tableaux. + +## Correctifs + +- **Parser** : accepter `ancrages` et `changes` en plus de `anchor` et `change`. +- **Répartition** : diriger `ancrages` et `anchor` vers `anchors`, `changes` et `change` vers `changes`. + +## Évolutions + +- Aucune. + +## Pages affectées + +- `signet-dashboard/public/utxo-list.html` : `parseUtxoLine`, boucles de push dans `loadUtxoList` +- `features/utxo-list-progressive-loading.md` : précision sur les catégories et la section Frais + +## Note + +La section **Frais** reste à 0 en chargement fichier : les frais viennent des métadonnées OP_RETURN (RPC), non du fichier. Comportement attendu. diff --git a/signet-dashboard/public/utxo-list.html b/signet-dashboard/public/utxo-list.html index 1180c6d..19b3555 100644 --- a/signet-dashboard/public/utxo-list.html +++ b/signet-dashboard/public/utxo-list.html @@ -682,8 +682,8 @@ lineCount++; if (utxo.category === 'bloc_rewards') blocRewards.push(utxo); - else if (utxo.category === 'anchor') anchors.push(utxo); - else if (utxo.category === 'change') changes.push(utxo); + else if (utxo.category === 'anchor' || utxo.category === 'ancrages') anchors.push(utxo); + else if (utxo.category === 'change' || utxo.category === 'changes') changes.push(utxo); else if (utxo.category === 'fee') fees.push(utxo); } @@ -700,8 +700,8 @@ if (utxo) { lineCount++; if (utxo.category === 'bloc_rewards') blocRewards.push(utxo); - else if (utxo.category === 'anchor') anchors.push(utxo); - else if (utxo.category === 'change') changes.push(utxo); + else if (utxo.category === 'anchor' || utxo.category === 'ancrages') anchors.push(utxo); + else if (utxo.category === 'change' || utxo.category === 'changes') changes.push(utxo); else if (utxo.category === 'fee') fees.push(utxo); } } @@ -759,7 +759,8 @@ } const c = (category || '').trim(); - if (c !== 'bloc_rewards' && c !== 'anchor' && c !== 'change' && c !== 'fee') return null; + const allowed = ['bloc_rewards', 'anchor', 'ancrages', 'change', 'changes', 'fee']; + if (!allowed.includes(c)) return null; const blockTime = (blockTimeRaw && blockTimeRaw.trim()) ? (parseInt(blockTimeRaw, 10) || null) : null;