feat(app): flag transactions above the newest checkpoint as not anchored

Blocks mined after the newest hardcoded checkpoint cannot be chained to it,
so only the Merkle proof against the server's header backs them. The
history list and the transaction detail now show a 'not anchored' label
for those transactions. Informational only: spending is not blocked.
See ADR 0041.
This commit is contained in:
davide committed 2026-11-03 15:11:06 +01:00
1 parent 24368a07b5
commit 305f22ed0e
13 files changed
+119 -7

No files matched your search

@@ -116,4 +116,23 @@ public class ChainProfileTests
data[3] = (byte)header;
return Encoders.Base58Check.EncodeData(data);
}
[Theory]
[InlineData(0, false)] // unconfirmed
[InlineData(1, false)]
[InlineData(100, false)] // at the newest checkpoint: still anchored
[InlineData(101, true)]
[InlineData(5_000_000, true)]
public void IsAboveNewestCheckpoint_flags_only_heights_the_anchoring_cannot_cover(int height, bool expected)
{
var profile = ChainProfiles.Mainnet with
{
Checkpoints = [new Checkpoint(50, "00", 0), new Checkpoint(100, "00", 0)],
};
Assert.Equal(expected, profile.IsAboveNewestCheckpoint(height));
}
[Fact]
public void A_profile_without_checkpoints_never_reports_an_unanchored_height() =>
Assert.False((ChainProfiles.Mainnet with { Checkpoints = [] }).IsAboveNewestCheckpoint(1_000_000));
}