rai/node/wallet.cpp
// Update work for account if latest root is root_a
Update work for account if latest root is root_a
Update work for account if latest root is root_a
void rai::wallet::work_update (MDB_txn * transaction_a, rai::account const & account_a, rai::block_hash const & root_a, uint64_t work_a)
{
    assert (!node.work.work_validate (root_a, work_a));
    assert (store.exists (transaction_a, account_a));
    auto latest (node.ledger.latest_root (transaction_a, account_a));
    if (latest == root_a)
    {
        store.work_put (transaction_a, account_a, work_a);
    }
    else
    {
        BOOST_LOG (node.log) << "Cached work no longer valid, discarding";
    }
}
void rai :: wallet :: work_update ( MDB_txn * transaction_a , rai :: account const & account_a , rai :: block_hash const & root_a , uint64_t work_a ) { assert ( ! node . work . work_validate ( root_a , work_a ) ) ; assert ( store . exists ( transaction_a , account_a ) ) ; auto latest ( node . ledger . latest_root ( transaction_a , account_a ) ) ; if ( latest == root_a ) { store . work_put ( transaction_a , account_a , work_a ) ; } else { BOOST_LOG ( node . log ) << " " ; } }
Update work for account if latest root is root_a
Update work for account if latest root is root_a