channeldb/channel: expose AckAddHtlc and AckSettleFail
This commit is contained in:
1 file changed
+25
@@ -1597,6 +1597,31 @@ func (c *OpenChannel) LoadFwdPkgs() ([]*FwdPkg, error) {
|
|||||||
return fwdPkgs, nil
|
return fwdPkgs, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AckAddHtlcs updates the AckAddFilter containing any of the provided AddRefs
|
||||||
|
// indicating that a response to this Add has been committed to the remote party.
|
||||||
|
// Doing so will prevent these Add HTLCs from being reforwarded internally.
|
||||||
|
func (c *OpenChannel) AckAddHtlcs(addRefs ...AddRef) error {
|
||||||
|
c.Lock()
|
||||||
|
defer c.Unlock()
|
||||||
|
|
||||||
|
return c.Db.Update(func(tx *bolt.Tx) error {
|
||||||
|
return c.Packager.AckAddHtlcs(tx, addRefs...)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// AckSettleFails updates the SettleFailFilter containing any of the provided
|
||||||
|
// SettleFailRefs, indicating that the response has been delivered to the
|
||||||
|
// incoming link, corresponding to a particular AddRef. Doing so will prevent
|
||||||
|
// the responses from being retransmitted internally.
|
||||||
|
func (c *OpenChannel) AckSettleFails(settleFailRefs ...SettleFailRef) error {
|
||||||
|
c.Lock()
|
||||||
|
defer c.Unlock()
|
||||||
|
|
||||||
|
return c.Db.Update(func(tx *bolt.Tx) error {
|
||||||
|
return c.Packager.AckSettleFails(tx, settleFailRefs...)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// SetFwdFilter atomically sets the forwarding filter for the forwarding package
|
// SetFwdFilter atomically sets the forwarding filter for the forwarding package
|
||||||
// identified by `height`.
|
// identified by `height`.
|
||||||
func (c *OpenChannel) SetFwdFilter(height uint64, fwdFilter *PkgFilter) error {
|
func (c *OpenChannel) SetFwdFilter(height uint64, fwdFilter *PkgFilter) error {
|
||||||
|
|||||||
Reference in new issue
Block a user