Merge pull request #4531 from halseth/switch-kvdb-view

[trivial] htlcswitch: use kvdb.View for loading fwdpkgs
This commit is contained in:
Conner Fromknecht 2020-08-20 12:58:28 -07:00 committed by GitHub
commit 47090c4902
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

@ -326,7 +326,7 @@ type SettleFailAcker interface {
type GlobalFwdPkgReader interface {
// LoadChannelFwdPkgs loads all known forwarding packages for the given
// channel.
LoadChannelFwdPkgs(tx kvdb.RwTx,
LoadChannelFwdPkgs(tx kvdb.RTx,
source lnwire.ShortChannelID) ([]*FwdPkg, error)
}
@ -364,7 +364,7 @@ func (*SwitchPackager) AckSettleFails(tx kvdb.RwTx,
}
// LoadChannelFwdPkgs loads all forwarding packages for a particular channel.
func (*SwitchPackager) LoadChannelFwdPkgs(tx kvdb.RwTx,
func (*SwitchPackager) LoadChannelFwdPkgs(tx kvdb.RTx,
source lnwire.ShortChannelID) ([]*FwdPkg, error) {
return loadChannelFwdPkgs(tx, source)

@ -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,