From e09c058bcaa6bb5f10366fd2401a191f331adc55 Mon Sep 17 00:00:00 2001 From: "Peter D. Gray" Date: Tue, 19 Apr 2022 09:18:17 -0400 Subject: [PATCH] Handle output scripts we dont understand (backport) --- shared/auth.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/shared/auth.py b/shared/auth.py index 2e6d467b..f9642eb8 100644 --- a/shared/auth.py +++ b/shared/auth.py @@ -377,9 +377,19 @@ class ApproveTransaction(UserAuthorizedAction): # - gives user-visible string # val = ' '.join(self.chain.render_value(o.nValue)) - dest = self.chain.render_address(o.scriptPubKey) + try: + dest = self.chain.render_address(o.scriptPubKey) - return '%s\n - to address -\n%s\n' % (val, dest) + return '%s\n - to address -\n%s\n' % (val, dest) + except ValueError: + pass + + # Handle future things better: allow them to happen at least. + self.psbt.warnings.append( + ('Output?', 'Sending to a script that is not well understood.')) + dest = B2A(o.scriptPubKey) + + return '%s\n - to script -\n%s\n' % (val, dest) async def interact(self):