src/interfaces/wallet.cpp
//! Construct wallet delegation staker info.
Construct wallet delegation staker info.
Construct wallet delegation staker info .
DelegationStakerInfo MakeWalletDelegationStakerInfo(CWallet& wallet, const uint160& id, const Delegation& delegation)
{
    DelegationStakerInfo result;
    result.delegate_address = EncodeDestination(PKHash(id));
    result.staker_address = EncodeDestination(PKHash(delegation.staker));
    result.PoD = HexStr(delegation.PoD);
    result.fee = delegation.fee;
    result.time = -1;
    wallet.chain().findBlock(wallet.chain().getBlockHash(delegation.blockHeight), FoundBlock().time(result.time));
    result.block_number = delegation.blockHeight;
    std::map<uint160, CAmount>::iterator it = wallet.m_delegations_weight.find(id);
    if(it != wallet.m_delegations_weight.end())
    {
        result.weight = it->second;
    }
    result.hash = id;
    return result;
}
DelegationStakerInfo MakeWalletDelegationStakerInfo ( CWallet & wallet , const uint160 & id , const Delegation & delegation ) { DelegationStakerInfo result ; result . delegate_address = EncodeDestination ( PKHash ( id ) ) ; result . staker_address = EncodeDestination ( PKHash ( delegation . staker ) ) ; result . PoD = HexStr ( delegation . PoD ) ; result . fee = delegation . fee ; result . time = -1 ; wallet . chain ( ) . findBlock ( wallet . chain ( ) . getBlockHash ( delegation . blockHeight ) , FoundBlock ( ) . time ( result . time ) ) ; result . block_number = delegation . blockHeight ; std :: map < uint160 , CAmount > :: iterator it = wallet . m_delegations_weight . find ( id ) ; if ( it != wallet . m_delegations_weight . end ( ) ) { result . weight = it -> second ; } result . hash = id ; return result ; }
Construct wallet delegation staker info.
Construct wallet delegation staker info .