• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lightningnetwork / lnd / 13035292482

29 Jan 2025 03:59PM UTC coverage: 49.3% (-9.5%) from 58.777%
13035292482

Pull #9456

github

mohamedawnallah
docs: update release-notes-0.19.0.md

In this commit, we warn users about the removal
of RPCs `SendToRoute`, `SendToRouteSync`, `SendPayment`,
and `SendPaymentSync` in the next release 0.20.
Pull Request #9456: lnrpc+docs: deprecate warning `SendToRoute`, `SendToRouteSync`, `SendPayment`, and `SendPaymentSync` in Release 0.19

100634 of 204126 relevant lines covered (49.3%)

1.54 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/channeldb/migration32/migration.go
1
package migration32
2

3
import (
4
        "bytes"
5
        "fmt"
6

7
        "github.com/lightningnetwork/lnd/kvdb"
8
)
9

10
// MigrateMCRouteSerialisation reads all the mission control store entries and
11
// re-serializes them using a minimal route serialisation so that only the parts
12
// of the route that are actually required for mission control are persisted.
13
func MigrateMCRouteSerialisation(tx kvdb.RwTx) error {
×
14
        log.Infof("Migrating Mission Control store to use a more minimal " +
×
15
                "encoding for routes")
×
16

×
17
        resultBucket := tx.ReadWriteBucket(resultsKey)
×
18

×
19
        // If the results bucket does not exist then there are no entries in
×
20
        // the mission control store yet and so there is nothing to migrate.
×
21
        if resultBucket == nil {
×
22
                return nil
×
23
        }
×
24

25
        // For each entry, read it into memory using the old encoding. Then,
26
        // extract the more minimal route, re-encode and persist the entry.
27
        return resultBucket.ForEach(func(k, v []byte) error {
×
28
                // Read the entry using the old encoding.
×
29
                resultOld, err := deserializeOldResult(k, v)
×
30
                if err != nil {
×
31
                        return err
×
32
                }
×
33

34
                // Convert to the new payment result format with the minimal
35
                // route.
36
                resultNew := convertPaymentResult(resultOld)
×
37

×
38
                // Serialise the new payment result using the new encoding.
×
39
                key, resultNewBytes, err := serializeNewResult(resultNew)
×
40
                if err != nil {
×
41
                        return err
×
42
                }
×
43

44
                // Make sure that the derived key is the same.
45
                if !bytes.Equal(key, k) {
×
46
                        return fmt.Errorf("new payment result key (%v) is "+
×
47
                                "not the same as the old key (%v)", key, k)
×
48
                }
×
49

50
                // Finally, overwrite the previous value with the new encoding.
51
                return resultBucket.Put(k, resultNewBytes)
×
52
        })
53
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc