mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-18 10:06:51 +01:00
multi: add new NoRevLogAmtData config option
In this commit, a new `--db.no-rev-log-amt-data` flag is added. The config option is passed though to everywhere that it will be used. Note that it is still a no-op in this commit. An upcoming commit will make use of the flag.
This commit is contained in:
@@ -223,7 +223,7 @@ type RevocationLog struct {
|
||||
// disk. It also saves our output index and their output index, which are
|
||||
// useful when creating breach retribution.
|
||||
func putRevocationLog(bucket kvdb.RwBucket, commit *mig.ChannelCommitment,
|
||||
ourOutputIndex, theirOutputIndex uint32) error {
|
||||
ourOutputIndex, theirOutputIndex uint32, noAmtData bool) error {
|
||||
|
||||
// Sanity check that the output indexes can be safely converted.
|
||||
if ourOutputIndex > math.MaxUint16 {
|
||||
|
||||
@@ -306,7 +306,7 @@ func setupTestLogs(db kvdb.Backend, c *mig26.OpenChannel,
|
||||
}
|
||||
|
||||
// Create new logs.
|
||||
return writeNewRevocationLogs(chanBucket, newLogs)
|
||||
return writeNewRevocationLogs(chanBucket, newLogs, !withAmtData)
|
||||
}, func() {})
|
||||
}
|
||||
|
||||
@@ -460,7 +460,7 @@ func writeOldRevocationLogs(chanBucket kvdb.RwBucket,
|
||||
|
||||
// writeNewRevocationLogs saves a new revocation log to db.
|
||||
func writeNewRevocationLogs(chanBucket kvdb.RwBucket,
|
||||
oldLogs []mig.ChannelCommitment) error {
|
||||
oldLogs []mig.ChannelCommitment, noAmtData bool) error {
|
||||
|
||||
// Don't bother continue if the logs are empty.
|
||||
if len(oldLogs) == 0 {
|
||||
@@ -480,7 +480,7 @@ func writeNewRevocationLogs(chanBucket kvdb.RwBucket,
|
||||
// old commit tx. We do this intentionally so we can
|
||||
// distinguish a newly created log from an already saved one.
|
||||
err := putRevocationLog(
|
||||
logBucket, &c, testOurIndex, testTheirIndex,
|
||||
logBucket, &c, testOurIndex, testTheirIndex, noAmtData,
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user