40 template<
typename U, u
int64_t (U::*)>
struct SFINAE {};
41 template<
typename U>
static char Test(SFINAE<U, &U::credits>*);
42 template<
typename U>
static int Test(...);
43 static const bool Has =
sizeof(Test<T>(0)) ==
sizeof(
char);
63 if (expected_credits == 0)
66 rpc_payment_state.
credits = post_call_credits;
69 if (pre_call_credits <= post_call_credits)
72 uint64_t cost = pre_call_credits - post_call_credits;
74 if (cost == expected_credits)
76 MDEBUG(
"Call " << call <<
" cost " << cost <<
" credits");
79 MWARNING(
"Call " << call <<
" cost " << cost <<
" credits, expected " << expected_credits);
81 if (cost > expected_credits)
84 if (rpc_payment_state.
discrepancy > std::numeric_limits<uint64_t>::max() -
d)
86 MERROR(
"Integer overflow in credit discrepancy calculation, setting to max");
87 rpc_payment_state.
discrepancy = std::numeric_limits<uint64_t>::max();
unsigned __int64 uint64_t
Definition stdint.h:136