1
0

wallet: only select mature coins by default

this is a regression from #5721

Removed the `TxInput.is_coinbase` method as I think it is a confusing API,
instead we now have `TxInput.is_coinbase_input` and `TxInput.is_coinbase_output`.

related #5872
This commit is contained in:
SomberNight
2020-01-02 00:43:49 +01:00
parent 6709ec4117
commit d2f132738a
10 changed files with 36 additions and 24 deletions

View File

@@ -539,7 +539,7 @@ class DigitalBitbox_KeyStore(Hardware_KeyStore):
# Build hasharray from inputs
for i, txin in enumerate(tx.inputs()):
if txin.is_coinbase():
if txin.is_coinbase_input():
self.give_error("Coinbase not supported") # should never happen
if txin.script_type != 'p2pkh':

View File

@@ -364,7 +364,7 @@ class KeepKeyPlugin(HW_PluginBase):
inputs = []
for txin in tx.inputs():
txinputtype = self.types.TxInputType()
if txin.is_coinbase():
if txin.is_coinbase_input():
prev_hash = b"\x00"*32
prev_index = 0xffffffff # signed int -1
else:

View File

@@ -330,7 +330,7 @@ class Ledger_KeyStore(Hardware_KeyStore):
# Fetch inputs of the transaction to sign
for txin in tx.inputs():
if txin.is_coinbase():
if txin.is_coinbase_input():
self.give_error("Coinbase not supported") # should never happen
if txin.script_type in ['p2sh']:

View File

@@ -338,7 +338,7 @@ class SafeTPlugin(HW_PluginBase):
inputs = []
for txin in tx.inputs():
txinputtype = self.types.TxInputType()
if txin.is_coinbase():
if txin.is_coinbase_input():
prev_hash = b"\x00"*32
prev_index = 0xffffffff # signed int -1
else:

View File

@@ -361,7 +361,7 @@ class TrezorPlugin(HW_PluginBase):
inputs = []
for txin in tx.inputs():
txinputtype = TxInputType()
if txin.is_coinbase():
if txin.is_coinbase_input():
prev_hash = b"\x00"*32
prev_index = 0xffffffff # signed int -1
else:

View File

@@ -38,7 +38,7 @@ def serialize_tx_in_legacy_format(tx: PartialTransaction, *, wallet: Multisig_Wa
tx = copy.deepcopy(tx)
def get_siglist(txin: 'PartialTxInput', *, estimate_size=False):
if txin.prevout.is_coinbase():
if txin.is_coinbase_input():
return [], []
if estimate_size:
try:
@@ -80,7 +80,7 @@ def serialize_tx_in_legacy_format(tx: PartialTransaction, *, wallet: Multisig_Wa
assert estimate_size is False
if txin.witness is not None:
return txin.witness.hex()
if txin.prevout.is_coinbase():
if txin.is_coinbase_input():
return ''
assert isinstance(txin, PartialTxInput)
if not self.is_segwit_input(txin):