| 1024 | } |
| 1025 | |
| 1026 | bool submitBlock(const CBlock& block_in, std::string& reason, std::string& debug) override |
| 1027 | { |
| 1028 | auto block = std::make_shared<const CBlock>(block_in); |
| 1029 | bool new_block; |
| 1030 | const bool accepted = SubmitBlock(chainman(), block, &new_block, reason, debug); |
| 1031 | // ProcessNewBlock() can accept and store a block before it is checked |
| 1032 | // for validity. Treat duplicates as errors for mining clients, and only |
| 1033 | // return success when validation completed without setting a reason. |
| 1034 | return accepted && new_block && reason.empty(); |
| 1035 | } |
| 1036 | |
| 1037 | const NodeContext* context() override { return &m_node; } |
| 1038 | ChainstateManager& chainman() { return *Assert(m_node.chainman); } |