lbryio / lbrycrd

The blockchain that provides the digital content namespace for the LBRY protocol
https://lbry.com
MIT License
2.58k stars 178 forks source link

added helper method for timelock, enabled signing of timelock #320

Closed BrannonKing closed 5 years ago

BrannonKing commented 5 years ago

The basic process:

1. cli addtimelockedaddress <block height or time> <receiver address 1>
2. cli sendtoadderss <address result from step 1> <amount>
3. cli getrawtransaction <txid from step 2> true
4. cli createrawtransaction '''[ {"txid":"<txid from step 2>", "vout":<n from step 3> } ]''' '''[ { "<receiver address 2>":<amount minus fee> } ]''' <block height from step 1>
On receiver machine:
5. importaddress <redeemScript from step 1> "" false true
6. cli signrawtransactionwithwallet <bytes from step 4>
7. cli sendrawtransaction <bytes from 6>

If you set the block height too low on 4 the signing will fail. If you try to send the transaction before the proper time the send will fail.