wtclient: only fetch retribution info when needed.
Only construct the retribution info at the time that the backup task is being bound to a session.
This commit is contained in:
4 files changed
+128
-114
No files matched your search
@@ -57,6 +57,11 @@ type sessionQueueConfig struct {
|
||||
// for justice transaction inputs.
|
||||
Signer input.Signer
|
||||
|
||||
// BuildBreachRetribution is a function closure that allows the client
|
||||
// to fetch the breach retribution info for a certain channel at a
|
||||
// certain revoked commitment height.
|
||||
BuildBreachRetribution BreachRetributionBuilder
|
||||
|
||||
// DB provides access to the client's stable storage.
|
||||
DB DB
|
||||
|
||||
@@ -220,7 +225,10 @@ func (q *sessionQueue) AcceptTask(task *backupTask) (reserveStatus, bool) {
|
||||
//
|
||||
// TODO(conner): queue backups and retry with different session params.
|
||||
case reserveAvailable:
|
||||
err := task.bindSession(&q.cfg.ClientSession.ClientSessionBody)
|
||||
err := task.bindSession(
|
||||
&q.cfg.ClientSession.ClientSessionBody,
|
||||
q.cfg.BuildBreachRetribution,
|
||||
)
|
||||
if err != nil {
|
||||
q.queueCond.L.Unlock()
|
||||
q.log.Debugf("SessionQueue(%s) rejected %v: %v ",
|
||||
|
||||
Reference in new issue
Block a user