rai/node/wallet.cpp
// Fetch work for root_a, use cached value if possible
Fetch work for root_a, use cached value if possible
Fetch work for root_a use cached value if possible
uint64_t rai::wallet::work_fetch (MDB_txn * transaction_a, rai::account const & account_a, rai::block_hash const & root_a)
{
    uint64_t result;
    auto error (store.work_get (transaction_a, account_a, result));
    if (error)
	{
        result = node.generate_work (root_a);
    }
	else
	{
		if (node.work.work_validate (root_a, result))
		{
			BOOST_LOG (node.log) << "Cached work invalid, regenerating";
			result = node.generate_work (root_a);
		}
	}
    return result;
}
uint64_t rai :: wallet :: work_fetch ( MDB_txn * transaction_a , rai :: account const & account_a , rai :: block_hash const & root_a ) { uint64_t result ; auto error ( store . work_get ( transaction_a , account_a , result ) ) ; if ( error ) { result = node . generate_work ( root_a ) ; } else { if ( node . work . work_validate ( root_a , result ) ) { BOOST_LOG ( node . log ) << " " ; result = node . generate_work ( root_a ) ; } } return result ; }
Fetch work for root_a, use cached value if possible
Fetch work for root_a use cached value if possible