Merge pull request #20540 from holiman/verbose_panic

core/state: add more verbosity to panic
This commit is contained in:
Péter Szilágyi 2020-01-10 11:36:21 +02:00 committed by GitHub
commit b5c4ea56b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -204,7 +204,7 @@ func (s *StateDB) AddRefund(gas uint64) {
func (s *StateDB) SubRefund(gas uint64) { func (s *StateDB) SubRefund(gas uint64) {
s.journal.append(refundChange{prev: s.refund}) s.journal.append(refundChange{prev: s.refund})
if gas > s.refund { if gas > s.refund {
panic("Refund counter below zero") panic(fmt.Sprintf("Refund counter below zero (gas: %d > refund: %d)", gas, s.refund))
} }
s.refund -= gas s.refund -= gas
} }