htlcswitch: use kvdb.View for loading fwdpkgs

Not necessary to open a write tx.
This commit is contained in:
Johan T. Halseth
2020-08-13 14:36:41 +02:00
parent 4674573e9a
commit 85b53c357f
2 changed files with 3 additions and 3 deletions

View File

@ -1811,7 +1811,7 @@ func (s *Switch) reforwardResponses() error {
func (s *Switch) loadChannelFwdPkgs(source lnwire.ShortChannelID) ([]*channeldb.FwdPkg, error) {
var fwdPkgs []*channeldb.FwdPkg
if err := kvdb.Update(s.cfg.DB, func(tx kvdb.RwTx) error {
if err := kvdb.View(s.cfg.DB, func(tx kvdb.RTx) error {
var err error
fwdPkgs, err = s.cfg.SwitchPackager.LoadChannelFwdPkgs(
tx, source,