forked from ethereum/go-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMETADATA_UPDATE_FIX.txt
More file actions
33 lines (25 loc) · 1.64 KB
/
METADATA_UPDATE_FIX.txt
File metadata and controls
33 lines (25 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
╔═══════════════════════════════════════════════════════════════╗
║ FIX: metadata.json est maintenant mis à jour lors ║
║ du rollback ! ║
╚═══════════════════════════════════════════════════════════════╝
PROBLÈME ORIGINAL:
Après un "geth rollback", le fichier metadata.json gardait
l'ancien numéro de bloc au lieu d'être mis à jour.
SOLUTION:
✓ Ajout de WriteBlockMetadata() dans core/blockchain.go
✓ Appel automatique après chaque rollback
✓ Message de confirmation affiché
FICHIERS MODIFIÉS:
• core/blockchain.go (+6 lignes)
• cmd/geth/chaincmd.go (+2 lignes pour l'appel)
UTILISATION:
$ geth rollback 5
Successfully rolled back from block #1000 to block #995 (5 blocks)
metadata.json updated with new head block #995
$ cat ~/.ethereum/metadata.json | jq '.blockNumber'
995 ← Correctement mis à jour !
DOCUMENTATION:
Voir ROLLBACK_METADATA_UPDATE.md pour plus de détails
═══════════════════════════════════════════════════════════════
Status: ✅ CORRIGÉ ET TESTÉ
═══════════════════════════════════════════════════════════════