Skip to content

Commit

Permalink
Make tx log informative
Browse files Browse the repository at this point in the history
  • Loading branch information
leventeliu committed May 15, 2019
1 parent c637d63 commit 94e5d57
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions blockproducer/metastate.go
Original file line number Diff line number Diff line change
Expand Up @@ -1173,16 +1173,22 @@ func (s *metaState) generateGenesisBlock(dbID proto.DatabaseID, tx *types.Create
}

func (s *metaState) apply(t pi.Transaction, height uint32) (err error) {
log.Infof("get tx: %s", t.GetTransactionType())
// NOTE(leventeliu): bypass pool in this method.
var (
addr = t.GetAccountAddress()
nonce = t.GetAccountNonce()
ttype = t.GetTransactionType()
)
log.WithFields(log.Fields{
"type": ttype,
"hash": t.Hash(),
"addr": addr,
"nonce": nonce,
}).Infof("apply tx")
// Check account nonce
var nextNonce pi.AccountNonce
if nextNonce, err = s.nextNonce(addr); err != nil {
if t.GetTransactionType() != pi.TransactionTypeBaseAccount {
if ttype != pi.TransactionTypeBaseAccount {
return
}
// Consider the first nonce 0
Expand Down

0 comments on commit 94e5d57

Please sign in to comment.