Skip to content

Commit

Permalink
trezorlib: Raise a more specific error when a prevtx is not provided
Browse files Browse the repository at this point in the history
  • Loading branch information
achow101 committed Jun 17, 2020
1 parent 45dbd08 commit 1613a33
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions hwilib/devices/trezorlib/btc.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
# You should have received a copy of the License along with this library.
# If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.

import binascii

from . import messages
from .tools import CallException, expect, normalize_nfc, session

Expand Down Expand Up @@ -119,6 +121,8 @@ def copy_tx_meta(tx):

# Device asked for one more information, let's process it.
if res.details.tx_hash is not None:
if res.details.tx_hash not in prev_txes:
raise ValueError('Previous transaction {} not available'.format(binascii.hexlify(res.details.tx_hash)))
current_tx = prev_txes[res.details.tx_hash]
else:
current_tx = this_tx
Expand Down

0 comments on commit 1613a33

Please sign in to comment.