| 49 | static RPCRawTransaction_ECC_Init ecc_init_on_load; |
| 50 | |
| 51 | UniValue ValueFromAmount(const CAmount amount) |
| 52 | { |
| 53 | static_assert(COIN > 1); |
| 54 | int64_t quotient = amount / COIN; |
| 55 | int64_t remainder = amount % COIN; |
| 56 | if (amount < 0) { |
| 57 | quotient = -quotient; |
| 58 | remainder = -remainder; |
| 59 | } |
| 60 | return UniValue(UniValue::VNUM, |
| 61 | strprintf("%s%d.%08d", amount < 0 ? "-" : "", quotient, remainder)); |
| 62 | } |
| 63 | |
| 64 | std::string FormatScript(const CScript& script) |
| 65 | { |