@@ -278,34 +278,34 @@ func (store *fileStore) NextTargetMsgSeqNum() int {
278278
279279// SetNextSenderMsgSeqNum sets the next MsgSeqNum that will be sent.
280280func (store * fileStore ) SetNextSenderMsgSeqNum (next int ) error {
281- if err := store .cache . SetNextSenderMsgSeqNum ( next ); err != nil {
282- return errors .Wrap (err , "cache " )
281+ if err := store .setSeqNum ( store . senderSeqNumsFile , next ); err != nil {
282+ return errors .Wrap (err , "file " )
283283 }
284- return store .setSeqNum ( store . senderSeqNumsFile , next )
284+ return store .cache . SetNextSenderMsgSeqNum ( next )
285285}
286286
287287// SetNextTargetMsgSeqNum sets the next MsgSeqNum that should be received.
288288func (store * fileStore ) SetNextTargetMsgSeqNum (next int ) error {
289- if err := store .cache . SetNextTargetMsgSeqNum ( next ); err != nil {
290- return errors .Wrap (err , "cache " )
289+ if err := store .setSeqNum ( store . targetSeqNumsFile , next ); err != nil {
290+ return errors .Wrap (err , "file " )
291291 }
292- return store .setSeqNum ( store . targetSeqNumsFile , next )
292+ return store .cache . SetNextTargetMsgSeqNum ( next )
293293}
294294
295295// IncrNextSenderMsgSeqNum increments the next MsgSeqNum that will be sent.
296296func (store * fileStore ) IncrNextSenderMsgSeqNum () error {
297- if err := store .cache .IncrNextSenderMsgSeqNum ( ); err != nil {
298- return errors .Wrap (err , "cache " )
297+ if err := store .SetNextSenderMsgSeqNum ( store . cache .NextSenderMsgSeqNum () + 1 ); err != nil {
298+ return errors .Wrap (err , "file " )
299299 }
300- return store . setSeqNum ( store . senderSeqNumsFile , store . cache . NextSenderMsgSeqNum ())
300+ return nil
301301}
302302
303303// IncrNextTargetMsgSeqNum increments the next MsgSeqNum that should be received.
304304func (store * fileStore ) IncrNextTargetMsgSeqNum () error {
305- if err := store .cache .IncrNextTargetMsgSeqNum ( ); err != nil {
306- return errors .Wrap (err , "cache " )
305+ if err := store .SetNextTargetMsgSeqNum ( store . cache .NextTargetMsgSeqNum () + 1 ); err != nil {
306+ return errors .Wrap (err , "file " )
307307 }
308- return store . setSeqNum ( store . targetSeqNumsFile , store . cache . NextTargetMsgSeqNum ())
308+ return nil
309309}
310310
311311// CreationTime returns the creation time of the store.
0 commit comments