fix crash bug tn2

This commit is contained in:
Richard Holland
2022-03-25 13:49:36 +00:00
parent fd5e02df08
commit 3aa1e1ef07
2 changed files with 6 additions and 1 deletions

View File

@@ -49,7 +49,9 @@ getFeeLevelPaid(ReadView const& view, STTx const& tx)
return std::pair{baseFee + ref, feePaid + ref};
}();
assert(baseFee.signum() > 0);
//RH TODO: check if >= 0 is appropriate for hooks / emitted txn
//this was previously > 0 and a crash bug in tn2
assert(baseFee.signum() >= 0);
if (effectiveFeePaid.signum() <= 0 || baseFee.signum() <= 0)
{
return FeeLevel64(0);

View File

@@ -47,6 +47,9 @@
#define HS_ACC() ctx.tx.getAccountID(sfAccount) << "-" << ctx.tx.getTransactionID()
namespace ripple {
//RH UPTO: sethook needs to correctly compute and charge fee for creating new hooks, updating existing hooks
//and it also needs to account for reserve requirements for namespaces, parameters and grants
// RH TODO test overflow on leb128 detection
// web assembly contains a lot of run length encoding in LEB128 format