From c6358c24d5522a206b8d783c94d2d8a1ccb1116c Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Mon, 12 Aug 2024 21:54:57 +0200 Subject: [PATCH] contract: ignore the difference in state and seals of output assignments Required for supporting LN channels --- src/contract/assignments.rs | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/contract/assignments.rs b/src/contract/assignments.rs index 65090546..d297722d 100644 --- a/src/contract/assignments.rs +++ b/src/contract/assignments.rs @@ -67,20 +67,10 @@ pub struct OutputAssignment { impl PartialEq for OutputAssignment { fn eq(&self, other: &Self) -> bool { - if self.opout == other.opout && - (self.seal != other.seal || - self.witness != other.witness || - self.state != other.state) - { - panic!( - "RGB was provided with an updated operation using different witness transaction. \ - This may happen for instance when some ephemeral state (like a commitment or \ - HTLC transactions in the lightning channels) is added to the stash.\nThis error \ - means the software uses RGB stash in an invalid way and has business logic bug \ - which has to be fixed.\nOperation in stash: {:?}\nNew operation: {:?}\n", - self, other - ) - } + // We ignore difference in witness transactions, state and seal definitions here + // in order to support updates from the ephemeral state of the lightning + // channels. See + // for the details. self.opout == other.opout } }