Fix UTXO-list: accept ancrages/changes from file, restore anchors and changes
**Motivations:** - Ancrages et Changes affichés à 0 sur /utxo-list en chargement fichier - Liste perçue comme erronée **Root causes:** - utxo_list.txt utilise ancrages/changes; parser n'acceptait que anchor/change - Lignes ancrages/changes rejetées par parseUtxoLine **Correctifs:** - Parser accepte ancrages et changes, push vers anchors/changes - Doc catégories et limite Frais (fichier) dans features + fixKnowledge **Evolutions:** - Aucune **Pages affectées:** - signet-dashboard/public/utxo-list.html - features/utxo-list-progressive-loading.md - fixKnowledge/utxo-list-file-category-mismatch.md
This commit is contained in:
parent
076b054b70
commit
7ab718aa9f
@ -41,7 +41,9 @@ Raccourcir le chargement de la page [Liste des UTXO](https://dashboard.certifica
|
|||||||
### Compatibilité
|
### Compatibilité
|
||||||
|
|
||||||
- Format 7 champs (nouveau) et 6 champs (ancien avec `address`) gérés par `parseUtxoLine`.
|
- 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).
|
- `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
|
## Modalités de déploiement
|
||||||
|
|
||||||
|
|||||||
37
fixKnowledge/utxo-list-file-category-mismatch.md
Normal file
37
fixKnowledge/utxo-list-file-category-mismatch.md
Normal file
@ -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.
|
||||||
@ -682,8 +682,8 @@
|
|||||||
|
|
||||||
lineCount++;
|
lineCount++;
|
||||||
if (utxo.category === 'bloc_rewards') blocRewards.push(utxo);
|
if (utxo.category === 'bloc_rewards') blocRewards.push(utxo);
|
||||||
else if (utxo.category === 'anchor') anchors.push(utxo);
|
else if (utxo.category === 'anchor' || utxo.category === 'ancrages') anchors.push(utxo);
|
||||||
else if (utxo.category === 'change') changes.push(utxo);
|
else if (utxo.category === 'change' || utxo.category === 'changes') changes.push(utxo);
|
||||||
else if (utxo.category === 'fee') fees.push(utxo);
|
else if (utxo.category === 'fee') fees.push(utxo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -700,8 +700,8 @@
|
|||||||
if (utxo) {
|
if (utxo) {
|
||||||
lineCount++;
|
lineCount++;
|
||||||
if (utxo.category === 'bloc_rewards') blocRewards.push(utxo);
|
if (utxo.category === 'bloc_rewards') blocRewards.push(utxo);
|
||||||
else if (utxo.category === 'anchor') anchors.push(utxo);
|
else if (utxo.category === 'anchor' || utxo.category === 'ancrages') anchors.push(utxo);
|
||||||
else if (utxo.category === 'change') changes.push(utxo);
|
else if (utxo.category === 'change' || utxo.category === 'changes') changes.push(utxo);
|
||||||
else if (utxo.category === 'fee') fees.push(utxo);
|
else if (utxo.category === 'fee') fees.push(utxo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -759,7 +759,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const c = (category || '').trim();
|
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;
|
const blockTime = (blockTimeRaw && blockTimeRaw.trim()) ? (parseInt(blockTimeRaw, 10) || null) : null;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user