forked from LBRYCommunity/lbry-sdk
add check for old fee format and throw releveant exception
This commit is contained in:
parent
522cb9cb82
commit
4bfd2e630b
1 changed files with 6 additions and 2 deletions
|
@ -1927,9 +1927,13 @@ class Daemon(AuthJSONRPCServer):
|
|||
|
||||
metadata['version'] = '_0_1_0'
|
||||
|
||||
# original format {'currency':{'address','amount'}}
|
||||
# add address to fee if unspecified {'version': ,'currency', 'address' , 'amount'}
|
||||
# check for original deprecated format {'currency':{'address','amount'}}
|
||||
# add address, version to fee if unspecified
|
||||
if 'fee' in metadata:
|
||||
if len(metadata['fee'].keys()) == 1 and isinstance(metadata['fee'].values()[0], dict):
|
||||
raise Exception('Old format for fee no longer supported. ' \
|
||||
'Fee must be specified as {"currency":,"address":,"amount":}')
|
||||
|
||||
if 'amount' in metadata['fee'] and 'currency' in metadata['fee']:
|
||||
if not metadata['fee']['amount']:
|
||||
log.warning("Stripping empty fee from published metadata")
|
||||
|
|
Loading…
Reference in a new issue