You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One benefit of the switch to segwit, is that light clients are able to fetch blocks without witness data if they don't actually need access to the witness items. However, we don't currently take advantage of the optimization. As a result, our bandwidth usage is higher than it actually should be.
In lnd (the biggest user of this project), we only need access to the witness data of a block if we're attempting to extract the pre-image from the witness of an htlc success sweeping transaction. In all other cases, we can do just fine with only the witness data. We should expose this information to callers of the rescan API to allow them to signal if they'd like the block w/ full witness data if the outpoint in question matters. Note that in the near future, we'll switch to matching on the previous output scripts instead.
Steps To Completion
Modify the rescan logic to store previous output scripts and output scripts in distinct slice .
When matching a block, only fetch the block w/ witness data if a previous output script matched. Note that this means we should always first match the previous output scripts to ensure that we don't miss any witness data.
Similarly, the GetUtxo method should be modified to add an additional functional parameter to allow callers to signal if they would like the spending transaction (if it exists) with witness data or not.
The text was updated successfully, but these errors were encountered:
One benefit of the switch to segwit, is that light clients are able to fetch blocks without witness data if they don't actually need access to the witness items. However, we don't currently take advantage of the optimization. As a result, our bandwidth usage is higher than it actually should be.
In
lnd
(the biggest user of this project), we only need access to the witness data of a block if we're attempting to extract the pre-image from the witness of an htlc success sweeping transaction. In all other cases, we can do just fine with only the witness data. We should expose this information to callers of the rescan API to allow them to signal if they'd like the block w/ full witness data if the outpoint in question matters. Note that in the near future, we'll switch to matching on the previous output scripts instead.Steps To Completion
Modify the rescan logic to store previous output scripts and output scripts in distinct slice .
When matching a block, only fetch the block w/ witness data if a previous output script matched. Note that this means we should always first match the previous output scripts to ensure that we don't miss any witness data.
If the filter does match an input, then we should fetch the block w/ witness data. Otherwise, just fetch the regular block.
Similarly, the
GetUtxo
method should be modified to add an additional functional parameter to allow callers to signal if they would like the spending transaction (if it exists) with witness data or not.The text was updated successfully, but these errors were encountered: