| 754 | } |
| 755 | |
| 756 | static std::string readStdin() |
| 757 | { |
| 758 | char buf[4096]; |
| 759 | std::string ret; |
| 760 | |
| 761 | while (!feof(stdin)) { |
| 762 | size_t bread = fread(buf, 1, sizeof(buf), stdin); |
| 763 | ret.append(buf, bread); |
| 764 | if (bread < sizeof(buf)) |
| 765 | break; |
| 766 | } |
| 767 | |
| 768 | if (ferror(stdin)) |
| 769 | throw std::runtime_error("error reading stdin"); |
| 770 | |
| 771 | boost::algorithm::trim_right(ret); |
| 772 | |
| 773 | return ret; |
| 774 | } |
| 775 | |
| 776 | static int CommandLineRawTx(int argc, char* argv[]) |
| 777 | { |