Add option --from-blockheight - #990
Conversation
|
Hi! Thanks for this, could you also look at #940 which has feedback from @cdecker and me? I think the right fix for this is to adjust the low watermark based on incoming transactions; @cdecker was looking at saving some of this information to the db, but perhaps we should just put a wallet low-watermark in there for now? |
| u32 locktime_max; | ||
|
|
||
| /* Add block from blockheight (-1 to use default chaintopology strategy). */ | ||
| s32 from_blockheight; |
There was a problem hiding this comment.
This is probably a y43k bug in the making 😉
There was a problem hiding this comment.
Do you suggest to use s64? or use a different default value?
|
|
||
| if (ld->config.from_blockheight > -1){ | ||
| // Get_init_blockhash() go back of 100 blocks | ||
| peer_first_blocknum = ld->config.from_blockheight + 100; |
There was a problem hiding this comment.
Are you sure that we want to start 100 blocks after the specified value?
There was a problem hiding this comment.
get_init_blockhash starts 100 blocks behind the selected block. If it is more safe to always consider 100 blocks before the selected input block ( so the first "Adding block", in the log, starts 100 blocks before the specified blockheight in the option), I will remove this sum.
There was a problem hiding this comment.
The + suggestes to me that if I specify height 500 this would start at 600 which is rather uexpected to me.
EDIT: Oh I see, it's compensating the -= 100 that we do in get_init_blockhash, I'd rather pull that subtraction out, instead of trying to compensate here.
|
Um, we're getting distracted :) The real fix is to put wallet utxss into the db; we can do the minimal thing if we want (just keep the low watermark in db vars) but I wanted to know if @cdecker had other plans to put wallet utxos into the db? |
|
Well we have our own UTXOs (except the |
With fallback depending on chainparams: this means the first upgrade will be slow, but after that it'll be fast. Fixes: ElementsProject#990 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
As described by @lvaccaro in ElementsProject#990. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
With fallback depending on chainparams: this means the first upgrade will be slow, but after that it'll be fast. Fixes: ElementsProject#990 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
As described by @lvaccaro in ElementsProject#990. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
With fallback depending on chainparams: this means the first upgrade will be slow, but after that it'll be fast. Fixes: #990 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Add option
--from-blockheightfor lightningd to define the first block to add at startup time.If not specify, or set to default value -1, lightningd uses the current strategy.
In according to
setup_topology(), block download starts one before the block selected in--from-blockheight.Help:
Example:
Resolve the following issue:
lightning-cli newaddr(for example at height 500000)lightning-cli listfundsshow outputs available to spentlightning-cli listfundsshows no outputsStart lightningd with the option
--from-blockheight 500000resolves this issue andlistfundsshows outputs available to spent.