From 5b93351166cbd066f0bcd96b60fe2be1e1f789af Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sat, 30 Mar 2024 11:56:42 +0100 Subject: [PATCH] dbc: add txid info to MergeRevealError --- dbc/src/anchor.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dbc/src/anchor.rs b/dbc/src/anchor.rs index 34f345bf..703ec9c5 100644 --- a/dbc/src/anchor.rs +++ b/dbc/src/anchor.rs @@ -86,7 +86,7 @@ impl TxWitness { pub fn merge_reveal(self, other: Self) -> Result { let txid = self.txid(); if txid != other.txid() { - return Err(MergeError::TxidMismatch); + return Err(MergeError::TxidMismatch(txid, other.txid())); } Ok(match (self, other) { (Self::Txid(txid), Self::Txid(_)) => Self::Txid(txid), @@ -149,9 +149,10 @@ pub enum MergeError { MpcMismatch(mpc::MergeError), /// anchors can't be merged since they have different witness transactions - TxidMismatch, + /// {0} and {1}. + TxidMismatch(Txid, Txid), - /// anchors can't be merged since they have different DBC proofs + /// anchors can't be merged since they have different DBC proofs. DbcMismatch, }