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

Merged
BrannonKing merged 1 commit from add_timelock_methods into master 2019-09-26 20:29:41 +02:00
BrannonKing commented 2019-09-25 22:46:10 +02:00 (Migrated from github.com)

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.
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. ```
bvbfan (Migrated from github.com) reviewed 2019-09-26 14:34:14 +02:00
bvbfan (Migrated from github.com) left a comment

Tested with commands above.

Tested with commands above.
@ -90,0 +93,4 @@
if (!script.GetOp(it, op))
return script;
if (!script.GetOp(it, op) || (op != OP_CHECKLOCKTIMEVERIFY && op != OP_CHECKSEQUENCEVERIFY))
bvbfan (Migrated from github.com) commented 2019-09-26 13:55:46 +02:00

Can we expect OP_CHECKSEQUENCEVERIFY since BIP112 is not enabled? I mean it should be filtered by interpreter and it shouldn't go here, no?

Can we expect OP_CHECKSEQUENCEVERIFY since BIP112 is not enabled? I mean it should be filtered by interpreter and it shouldn't go here, no?
bvbfan (Migrated from github.com) approved these changes 2019-09-26 14:36:27 +02:00
BrannonKing (Migrated from github.com) reviewed 2019-09-26 19:04:04 +02:00
@ -90,0 +93,4 @@
if (!script.GetOp(it, op))
return script;
if (!script.GetOp(it, op) || (op != OP_CHECKLOCKTIMEVERIFY && op != OP_CHECKSEQUENCEVERIFY))
BrannonKing (Migrated from github.com) commented 2019-09-26 19:04:04 +02:00

CSV is enabled. getblockchaininfo shows that it is active.

CSV is enabled. getblockchaininfo shows that it is active.
bvbfan (Migrated from github.com) reviewed 2019-09-26 19:35:25 +02:00
@ -90,0 +93,4 @@
if (!script.GetOp(it, op))
return script;
if (!script.GetOp(it, op) || (op != OP_CHECKLOCKTIMEVERIFY && op != OP_CHECKSEQUENCEVERIFY))
bvbfan (Migrated from github.com) commented 2019-09-26 19:35:25 +02:00
You're right i made assumption by bit value https://github.com/lbryio/lbrycrd/blob/master/src/chainparams.cpp#L159
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbrycrd#320
No description provided.