treturn txid for unsigned segwit transactions - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit aed2b04dbdb6d52e3db42b15e7dffc7c220e7b76 DIR parent 326b083f84243623511d00bc238d99779eeaaf6e HTML Author: ThomasV <thomasv@electrum.org> Date: Tue, 31 Jan 2017 16:32:11 +0100 return txid for unsigned segwit transactions Diffstat: M lib/transaction.py | 3 +++ M lib/wallet.py | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) --- DIR diff --git a/lib/transaction.py b/lib/transaction.py t@@ -722,6 +722,9 @@ class Transaction: return self.txid() def txid(self): + all_segwit = all(self.is_segwit_input(x) for x in self.inputs()) + if not all_segwit and not self.is_complete(): + return None ser = self.serialize(witness=False) return Hash(ser.decode('hex'))[::-1].encode('hex') DIR diff --git a/lib/wallet.py b/lib/wallet.py t@@ -436,8 +436,8 @@ class Abstract_Wallet(PrintError): can_bump = False label = '' height = conf = timestamp = None + tx_hash = tx.txid() if tx.is_complete(): - tx_hash = tx.txid() if tx_hash in self.transactions.keys(): label = self.get_label(tx_hash) height, conf, timestamp = self.get_tx_height(tx_hash) t@@ -461,7 +461,6 @@ class Abstract_Wallet(PrintError): else: s, r = tx.signature_count() status = _("Unsigned") if s == 0 else _('Partially signed') + ' (%d/%d)'%(s,r) - tx_hash = None if is_relevant: if is_mine: