Skip to content

Commit

Permalink
If keys are empty try with next higher permission
Browse files Browse the repository at this point in the history
  • Loading branch information
holgern committed May 27, 2018
1 parent 818c8f1 commit 56faf8c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions beem/transactionbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ def fetchkeys(account, perm, level=0):
raise AssertionError("Could not access permission")
required_treshold = account[permission]["weight_threshold"]
keys = fetchkeys(account, permission)
# If keys are empty, try again with active key
if not keys and permission == "posting":
_keys = fetchkeys(account, "active")
keys.extend(_keys)
# If keys are empty, try again with owner key
if not keys and permission != "owner":
_keys = fetchkeys(account, "owner")
Expand Down

0 comments on commit 56faf8c

Please sign in to comment.