| 535 | } |
| 536 | |
| 537 | static CAmount AmountFromValue(const UniValue& value) |
| 538 | { |
| 539 | if (!value.isNum() && !value.isStr()) |
| 540 | throw std::runtime_error("Amount is not a number or string"); |
| 541 | CAmount amount; |
| 542 | if (!ParseFixedPoint(value.getValStr(), 8, &amount)) |
| 543 | throw std::runtime_error("Invalid amount"); |
| 544 | if (!MoneyRange(amount)) |
| 545 | throw std::runtime_error("Amount out of range"); |
| 546 | return amount; |
| 547 | } |
| 548 | |
| 549 | static void MutateTxSign(CMutableTransaction& tx, const std::string& flagStr) |
| 550 | { |
no test coverage detected