signer: fix log flaw with string pointer

This commit is contained in:
Martin Holst Swende 2018-02-17 14:09:19 +01:00
parent be24e89a8f
commit 8bc021386f
No known key found for this signature in database
GPG key ID: 683B438C05A5DDF0

View file

@ -23,8 +23,8 @@ import (
"github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/internal/ethapi" "github.com/ethereum/go-ethereum/internal/ethapi"
"github.com/ethereum/go-ethereum/log"
) )
type AuditLogger struct { type AuditLogger struct {
@ -43,9 +43,14 @@ func (l *AuditLogger) New(ctx context.Context) (accounts.Account, error) {
} }
func (l *AuditLogger) SignTransaction(ctx context.Context, args SendTxArgs, methodSelector *string) (*ethapi.SignTransactionResult, error) { func (l *AuditLogger) SignTransaction(ctx context.Context, args SendTxArgs, methodSelector *string) (*ethapi.SignTransactionResult, error) {
sel := "<nil>"
if methodSelector != nil {
sel = *methodSelector
}
l.log.Info("SignTransaction", "type", "request", "metadata", MetadataFromContext(ctx).String(), l.log.Info("SignTransaction", "type", "request", "metadata", MetadataFromContext(ctx).String(),
"tx", args.String(), "tx", args.String(),
"methodSelector", methodSelector) "methodSelector", sel)
res, e := l.api.SignTransaction(ctx, args, methodSelector) res, e := l.api.SignTransaction(ctx, args, methodSelector)
if res != nil { if res != nil {
l.log.Info("SignTransaction", "type", "response", "data", common.Bytes2Hex(res.Raw), "error", e) l.log.Info("SignTransaction", "type", "response", "data", common.Bytes2Hex(res.Raw), "error", e)