diff --git a/src/Negentropy/Negentropy.cs b/src/Negentropy/Negentropy.cs index 476bc17..d25181a 100644 --- a/src/Negentropy/Negentropy.cs +++ b/src/Negentropy/Negentropy.cs @@ -66,7 +66,7 @@ public NegentropyReconciliation Reconcile(string query) if (version != PROTOCOL_VERSION) { if (this.isInitiator) throw new InvalidOperationException("unsupported negentropy protocol version requested: " + (version - 0x60)); - else writer.ToHexString(); + else return new NegentropyReconciliation(writer.ToHexString(), [], []); } var prevBoundOut = Bound.Min; diff --git a/test/Negentropy.Tests/ReconcileTests.cs b/test/Negentropy.Tests/ReconcileTests.cs index 90bcec7..5f8432e 100644 --- a/test/Negentropy.Tests/ReconcileTests.cs +++ b/test/Negentropy.Tests/ReconcileTests.cs @@ -223,6 +223,16 @@ public void LoadFromFileFrameSizeLimit() //result = ne1.Reconcile(result.Query); //result.Query.Should().Be(expectations[4]); + + } + + [Fact] + public void VersionFallbackTest() + { + var ne = new NegentropyBuilder(new NegentropyOptions()).Build(); + var result = ne.Reconcile("62aabbccddeeff"); + + result.Query.Should().Be("61"); } } }