Skip to content

Commit

Permalink
Add check to see if broadcast transaction target tick is smaller than…
Browse files Browse the repository at this point in the history
… network tick + 15
  • Loading branch information
LINCKODE committed Jul 30, 2024
1 parent 5ff4711 commit d54bc75
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions foundation/rpc_server/rpc_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"context"
"encoding/base64"
"encoding/json"
"fmt"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/pkg/errors"
"github.com/qubic/go-node-connector/types"
Expand Down Expand Up @@ -187,6 +188,10 @@ func (s *Server) BroadcastTransaction(ctx context.Context, req *protobuff.Broadc
return nil, status.Error(codes.Internal, err.Error())
}

if transaction.Tick < maxTick+15 {
fmt.Printf("WARN: Transaction %s has a taget tick smaller than network tick(%d) + 15(%d)", transactionId, maxTick, maxTick+15)
}

return &protobuff.BroadcastTransactionResponse{
PeersBroadcasted: int32(broadcastTxToMultiple(ctx, s.qPool, decodedTx)),
EncodedTransaction: req.EncodedTransaction,
Expand Down

0 comments on commit d54bc75

Please sign in to comment.