state: should a transaction fail to be applied to the ledger, still increment the nonce of the account
@@ -138,9 +138,10 @@ func (s *state) applyTransaction(tx *database.Transaction) error {
deltas, newlyPending, err := s.doApplyTransaction(tx)
if err != nil {
- return err
+ log.Warn().Interface("tx", tx).Err(err).Msg("Transaction failed to get applied to the ledger state.")
}
+ if err == nil {
for _, delta := range deltas {
accountID := writeString(delta.Account)
@@ -164,6 +165,7 @@ func (s *state) applyTransaction(tx *database.Transaction) error {
accountDeltas.Deltas[accountID].List = append(accountDeltas.Deltas[accountID].List, delta)
}
+ }
// Increment the senders account nonce.
accounts[writeString(sender.PublicKey)].Nonce++
