Adding processed RPC block to blocks observers
This commit is contained in:
parent
2fb980818a
commit
943b601fc0
1 changed files with 6 additions and 2 deletions
|
@ -2333,12 +2333,16 @@ void rai::rpc_handler::process ()
|
|||
auto hash (block->hash ());
|
||||
node.block_arrival.add (hash);
|
||||
rai::process_return result;
|
||||
rai::transaction transaction (node.store.environment, nullptr, true);
|
||||
result = node.block_processor.process_receive_one (transaction, std::move (block));
|
||||
std::shared_ptr <rai::block> block_a (std::move (block));
|
||||
{
|
||||
rai::transaction transaction (node.store.environment, nullptr, true);
|
||||
result = node.block_processor.process_receive_one (transaction, block_a);
|
||||
}
|
||||
switch (result.code)
|
||||
{
|
||||
case rai::process_result::progress:
|
||||
{
|
||||
node.observers.blocks (block_a, result.account, result.amount);
|
||||
boost::property_tree::ptree response_l;
|
||||
response_l.put ("hash", hash.to_string ());
|
||||
response (response_l);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue