MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / submitBlock

Method submitBlock

src/node/interfaces.cpp:1026–1035  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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); }

Callers 3

assert_submit_blockMethod · 0.80
async_routineMethod · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80

Calls 2

SubmitBlockFunction · 0.85
emptyMethod · 0.45

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.64