graph+discovery: calculate funding tx script in gossiper
In preparation for an upcoming commit which will move all channel funding tx validation to the gossiper, we first move the helper method which helps build the expected funding transaction script based on the fields in the channel announcement. We will still want this script later on in the builder for updating the ChainView though, and so we pass this field along with the ChannelEdgeInfo. With this change, we can remove the TapscriptRoot field from the ChannelEdgeInfo since the only reason it was there was so that the builder could reconstruct the full funding script.
This commit is contained in:
3 files changed
+89
-85
No files matched your search
@@ -63,10 +63,11 @@ type ChannelEdgeInfo struct {
|
||||
// the value output in the outpoint that created this channel.
|
||||
Capacity btcutil.Amount
|
||||
|
||||
// TapscriptRoot is the optional Merkle root of the tapscript tree if
|
||||
// this channel is a taproot channel that also commits to a tapscript
|
||||
// tree (custom channel).
|
||||
TapscriptRoot fn.Option[chainhash.Hash]
|
||||
// FundingScript holds the script of the channel's funding transaction.
|
||||
//
|
||||
// NOTE: this is not currently persisted and so will not be present if
|
||||
// the edge object is loaded from the database.
|
||||
FundingScript fn.Option[[]byte]
|
||||
|
||||
// ExtraOpaqueData is the set of data that was appended to this
|
||||
// message, some of which we may not actually know how to iterate or
|
||||
|
||||
Reference in new issue
Block a user