Skip to content

Commit

Permalink
Merge #983: Add single UTXO fb warning to gettimelockaddress
Browse files Browse the repository at this point in the history
148f970 Add single UTXO fb warning to gettimelockaddress (Kristaps Kaupe)
  • Loading branch information
AdamISZ committed Aug 11, 2021
2 parents 6d2fa82 + 148f970 commit fb39857
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions jmclient/jmclient/wallet_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1222,21 +1222,24 @@ def wallet_gettimelockaddress(wallet, locktime_string):
jmprint("Error: not a fidelity bond wallet", "error")
return ""

m = FidelityBondMixin.FIDELITY_BOND_MIXDEPTH
address_type = FidelityBondMixin.BIP32_TIMELOCK_ID

lock_datetime = datetime.strptime(locktime_string, "%Y-%m")
if jm_single().config.get("BLOCKCHAIN", "network") == "mainnet" and lock_datetime <= datetime.now():
jmprint("Error: locktime must be a future date", "error")
return ""

m = FidelityBondMixin.FIDELITY_BOND_MIXDEPTH
address_type = FidelityBondMixin.BIP32_TIMELOCK_ID
timenumber = FidelityBondMixin.datetime_to_time_number(lock_datetime)

path = wallet.get_path(m, address_type, timenumber)
jmprint("path = " + wallet.get_path_repr(path), "info")
jmprint("Coins sent to this address will be not be spendable until "
+ lock_datetime.strftime("%B %Y") + ". Full date: "
+ str(lock_datetime))
jmprint("WARNING: You should send coins to this address only once."
+ " Only single biggest value UTXO will be announced as a fidelity bond."
+ " Sending coins to this address multiple times will not increase"
+ " fidelity bond value.")
jmprint("WARNING: Only send coins here which are from coinjoins or otherwise"
+ " not linked to your identity. Also, use a sweep transaction when funding the"
+ " timelocked address, i.e. Don't create a change address. See the privacy warnings in"
Expand Down

0 comments on commit fb39857

Please sign in to comment.