@@ -163,13 +163,13 @@ func (n *NodeConn) CtxFunc() context.Context {
163
163
// NOTE: this function is a callback to be used by the mailbox package during
164
164
// the mailbox.NewConnData call.
165
165
func (n * NodeConn ) onRemoteStatic (key * btcec.PublicKey ) error {
166
+ remoteKey := key .SerializeCompressed ()
167
+
166
168
ctxt , cancel := context .WithTimeout (
167
- context .Background (), time . Second * 10 ,
169
+ context .Background (), DefaultStoreTimetout ,
168
170
)
169
171
defer cancel ()
170
172
171
- remoteKey := key .SerializeCompressed ()
172
-
173
173
err := n .store .SetRemotePubKey (
174
174
ctxt , n .session .PassphraseEntropy , remoteKey ,
175
175
)
@@ -226,8 +226,12 @@ func (n *NodeConn) onAuthData(data []byte) error {
226
226
// microseconds, but we can store the correct one here.
227
227
n .session .Expiry = & expiry
228
228
229
- ctxb := context .Background ()
230
- err = n .store .SetExpiry (ctxb , n .session .PassphraseEntropy , expiry )
229
+ ctxt , cancel := context .WithTimeout (
230
+ context .Background (), DefaultStoreTimetout ,
231
+ )
232
+ defer cancel ()
233
+
234
+ err = n .store .SetExpiry (ctxt , n .session .PassphraseEntropy , expiry )
231
235
if err != nil {
232
236
log .Errorf ("unable to set expiry for session(%x): %w" ,
233
237
n .session .PassphraseEntropy , err )
0 commit comments