gitmark 0.0.75 → 0.0.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/git-mark.js +19 -0
- package/package.json +1 -1
package/bin/git-mark.js
CHANGED
|
@@ -455,6 +455,25 @@ async function cmdInfo() {
|
|
|
455
455
|
}
|
|
456
456
|
}
|
|
457
457
|
} catch (e) {}
|
|
458
|
+
|
|
459
|
+
// Check chain depth safety
|
|
460
|
+
const numMarks = trail.states.length;
|
|
461
|
+
if (numMarks < 25) {
|
|
462
|
+
console.log(`Chain depth: safe (${numMarks} marks, under 25)`);
|
|
463
|
+
} else {
|
|
464
|
+
try {
|
|
465
|
+
const ancestorTxo = parseTxoUri(trail.txo[trail.txo.length - 24]);
|
|
466
|
+
const ancResp = await fetch(`${explorer}/tx/${ancestorTxo.txid}`);
|
|
467
|
+
if (ancResp.ok) {
|
|
468
|
+
const ancData = await ancResp.json();
|
|
469
|
+
if (ancData.status?.confirmed) {
|
|
470
|
+
console.log(`Chain depth: safe (ancestor at -24 confirmed)`);
|
|
471
|
+
} else {
|
|
472
|
+
console.log(`Chain depth: ⚠ ancestor at -24 unconfirmed`);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
} catch (e) {}
|
|
476
|
+
}
|
|
458
477
|
}
|
|
459
478
|
}
|
|
460
479
|
if (priv) {
|