watchtower/wtdb: create embedded ClientSessionBody
This commit splits out the portions of the ClientSession into an embedded ClientSessionBody, since these fields will be serialized together on-disk.
This commit is contained in:
6 files changed
+59
-37
No files matched your search
@@ -417,14 +417,15 @@ func (n *sessionNegotiator) tryAddress(privKey *btcec.PrivateKey,
|
||||
privKey.PubKey(),
|
||||
)
|
||||
clientSession := &wtdb.ClientSession{
|
||||
TowerID: tower.ID,
|
||||
ClientSessionBody: wtdb.ClientSessionBody{
|
||||
TowerID: tower.ID,
|
||||
KeyIndex: keyIndex,
|
||||
Policy: n.cfg.Policy,
|
||||
RewardPkScript: rewardPkScript,
|
||||
},
|
||||
Tower: tower,
|
||||
KeyIndex: keyIndex,
|
||||
SessionPrivKey: privKey,
|
||||
ID: sessionID,
|
||||
Policy: n.cfg.Policy,
|
||||
SeqNum: 0,
|
||||
RewardPkScript: rewardPkScript,
|
||||
}
|
||||
|
||||
err = n.cfg.DB.CreateClientSession(clientSession)
|
||||
|
||||
Reference in new issue
Block a user