modify some msg-struct and table-struct

This commit is contained in:
lzx
2025-11-14 17:43:25 +08:00
parent 245c9c94cb
commit ac22db02f3
11 changed files with 605 additions and 276 deletions

View File

@@ -2,10 +2,8 @@ package logger
import (
"compress/gzip"
"encoding/json"
"fmt"
"io"
message "m2pool-payment/internal/msg"
"os"
"path/filepath"
"sync"
@@ -233,7 +231,7 @@ func LogWithdraw(fromAddress string, status string, amount float64, toAddress st
}
// LogPay 记录支付消息
func LogPay(status string, fromAddress string, queueId string, transactions map[string]*message.PayData) {
func LogPay(status string, fromAddress string, queueId string) {
if txLogger == nil {
return
}
@@ -244,14 +242,14 @@ func LogPay(status string, fromAddress string, queueId string, transactions map[
fmt.Printf("⚠️ 获取日志文件失败: %v\n", err)
return
}
t, err := json.Marshal(transactions)
if err != nil {
fmt.Println("Error marshalling to JSON:", err)
return
}
// t, err := json.Marshal(transactions)
// if err != nil {
// fmt.Println("Error marshalling to JSON:", err)
// return
// }
timestamp := time.Now().Format("2006-01-02 15:04:05")
content := fmt.Sprintf("%s [pay]-[%s] | FromAddress: %s | QueueId: %s | Transactions: %v",
timestamp, status, fromAddress, queueId, string(t))
content := fmt.Sprintf("%s [pay]-[%s] | FromAddress: %s | QueueId: %s",
timestamp, status, fromAddress, queueId)
if err := lf.write(content); err != nil {
fmt.Printf("⚠️ 写入日志失败: %v\n", err)