channeldb: add custom blobs to RevocationLog+HTLCEntry

This'll be useful for custom channel types that want to store extra information that'll be useful to help handle channel revocation cases.
This commit is contained in:
Olaoluwa Osuntokun authored and Oliver Gugger committed 2024-08-28 13:23:30 +02:00
1 parent 61f276856a
commit 669740c84e
4 files changed
+120 -21

No files matched your search

+5 -1
View File
@@ -2420,7 +2420,11 @@ func createBreachRetributionLegacy(revokedLog *channeldb.ChannelCommitment,
continue
}
entry := channeldb.NewHTLCEntryFromHTLC(htlc)
entry, err := channeldb.NewHTLCEntryFromHTLC(htlc)
if err != nil {
return nil, 0, 0, err
}
hr, err := createHtlcRetribution(
chanState, keyRing, commitHash,
commitmentSecret, leaseExpiry, entry,
+1 -1
View File
@@ -10031,7 +10031,7 @@ func TestCreateBreachRetribution(t *testing.T) {
revokedLog := channeldb.NewRevocationLog(
uint16(localIndex), uint16(remoteIndex), commitHash,
fn.Some(ourAmtMsat), fn.Some(theirAmtMsat),
[]*channeldb.HTLCEntry{htlc},
[]*channeldb.HTLCEntry{htlc}, fn.None[tlv.Blob](),
)
// Create a log with an empty local output index.