src/activemasternode.cpp
// Extract Masternode vin information from output
Extract Masternode vin information from output
Extract Masternode vin information from output
bool CActiveMasternode::GetVinFromOutput(COutput out, CTxIn& vin, CPubKey& pubkey, CKey& secretKey) {
    CScript pubScript;
    vin = CTxIn(out.tx->GetHash(),out.i);
    pubScript = out.tx->vout[out.i].scriptPubKey; 
    CTxDestination address1;
    ExtractDestination(pubScript, address1);
    CBitcoinAddress address2(address1);
    CKeyID keyID;
    if (!address2.GetKeyID(keyID)) {
        LogPrintf("CActiveMasternode::GetMasterNodeVin - Address does not refer to a key\n");
        return false;
    }
    if (!pwalletMain->GetKey(keyID, secretKey)) {
        LogPrintf ("CActiveMasternode::GetMasterNodeVin - Private key for address is not known\n");
        return false;
    }
    pubkey = secretKey.GetPubKey();
    return true;
}
bool CActiveMasternode :: GetVinFromOutput ( COutput out , CTxIn & vin , CPubKey & pubkey , CKey & secretKey ) { CScript pubScript ; vin = CTxIn ( out . tx -> GetHash ( ) , out . i ) ; pubScript = out . tx -> vout [ out . i ] . scriptPubKey ; CTxDestination address1 ; ExtractDestination ( pubScript , address1 ) ; CBitcoinAddress address2 ( address1 ) ; CKeyID keyID ; if ( ! address2 . GetKeyID ( keyID ) ) { LogPrintf ( " \n " ) ; return false ; } if ( ! pwalletMain -> GetKey ( keyID , secretKey ) ) { LogPrintf ( " \n " ) ; return false ; } pubkey = secretKey . GetPubKey ( ) ; return true ; }
Extract Masternode vin information from output
Extract Masternode vin information from output
// the inputs PubKey