From 8b152f3c96653243c81d8f525938a51384c63c9e Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Wed, 26 Jun 2019 10:44:25 -0400 Subject: [PATCH] check for valid fee.currency and fee.amount before processing --- lbry/lbry/wallet/server/db.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lbry/lbry/wallet/server/db.py b/lbry/lbry/wallet/server/db.py index f1d8f0499..58c56355e 100644 --- a/lbry/lbry/wallet/server/db.py +++ b/lbry/lbry/wallet/server/db.py @@ -298,8 +298,11 @@ class SQLDB: if claim.stream.release_time: claim_record['release_time'] = claim.stream.release_time if claim.stream.has_fee: - claim_record['fee_currency'] = claim.stream.fee.currency.lower() - claim_record['fee_amount'] = int(claim.stream.fee.amount*1000) + fee = claim.stream.fee + if isinstance(fee.currency, str): + claim_record['fee_currency'] = fee.currency.lower() + if isinstance(fee.amount, Decimal): + claim_record['fee_amount'] = int(fee.amount*1000) elif claim.is_channel: claim_record['claim_type'] = CLAIM_TYPES['channel']