From 0237bb23dafaee4482ba48470076e8c5fa58fb63 Mon Sep 17 00:00:00 2001 From: scgbckbone Date: Mon, 6 Jun 2022 17:06:37 +0200 Subject: [PATCH] multisig wallet order does not matter --- releases/ChangeLog.md | 3 +++ shared/multisig.py | 3 +++ shared/psbt.py | 3 +-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/releases/ChangeLog.md b/releases/ChangeLog.md index dfadd1ad..367e48f7 100644 --- a/releases/ChangeLog.md +++ b/releases/ChangeLog.md @@ -1,3 +1,6 @@ +## 4.1.6 - June 6, 2022 +- Bugfix: order of multisig wallet registration does NOT matter in PSBT signing + ## 4.1.5 - May 4, 2022 - Enhancement: Support P2TR outputs (pay to Taproot) in PSBT files. Allows diff --git a/shared/multisig.py b/shared/multisig.py index 4ce66e4f..780b5d01 100644 --- a/shared/multisig.py +++ b/shared/multisig.py @@ -278,6 +278,9 @@ class MultisigWallet: # the same prefix path per-each xfp, as indicated # xfp_paths (unordered)? # - could also check non-prefix part is all non-hardened + if len(xfp_paths) != len(self.xfp_paths): + # cannot be the same if len(w0.N) != len(w1.N) + return False for x in xfp_paths: if x[0] not in self.xfp_paths: return False diff --git a/shared/psbt.py b/shared/psbt.py index 123aec27..ccd93224 100644 --- a/shared/psbt.py +++ b/shared/psbt.py @@ -1071,8 +1071,7 @@ class psbtObject(psbtProxy): assert N == len(xfp_paths) for c in candidates: - if c.M == M: - assert c.N == N + if c.M == M and c.N == N: self.active_multisig = c break