Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion blockproducer/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ func (c *Chain) syncCurrentHead(ctx context.Context, requiredReachable uint32) (
log.Fatalf("unknown run mode: %v", c.mode)
}

if ok {
if !ok {
log.WithFields(log.Fields{
"peer": c.getLocalBPInfo(),
"sync_head_height": currentHeight,
Expand Down
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