diff --git a/AccountState.h b/AccountState.h index c3958cff0..c321b9526 100644 --- a/AccountState.h +++ b/AccountState.h @@ -30,8 +30,9 @@ public: uint32 getSeq() const { return mAccountSeq; } bool charge(uint64 a) { mBalance+=a; } - bool credit(uint64 a) { mBalance-=a; } + bool credit(uint64 a) { assert(mBalance>=a); mBalance-=a; } void incSeq(void) { mAccountSeq++; } + void decSeq(void) { assert(mAccountSeq!=0); mAccountSeq--; } std::vector getRaw() const; };