rpc: fix issue for querying txids for p2sh addresses
This commit is contained in:
committed by
Braydon Fuller
parent
18ea599a71
commit
fcac6bcdc8
@@ -262,6 +262,23 @@ CTxDestination CBitcoinAddress::Get() const
|
||||
return CNoDestination();
|
||||
}
|
||||
|
||||
bool CBitcoinAddress::GetIndexKey(uint160& hashBytes, int& type) const
|
||||
{
|
||||
if (!IsValid()) {
|
||||
return false;
|
||||
} else if (vchVersion == Params().Base58Prefix(CChainParams::PUBKEY_ADDRESS)) {
|
||||
memcpy(&hashBytes, &vchData[0], 20);
|
||||
type = 1;
|
||||
return true;
|
||||
} else if (vchVersion == Params().Base58Prefix(CChainParams::SCRIPT_ADDRESS)) {
|
||||
memcpy(&hashBytes, &vchData[0], 20);
|
||||
type = 2;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CBitcoinAddress::GetKeyID(CKeyID& keyID) const
|
||||
{
|
||||
if (!IsValid() || vchVersion != Params().Base58Prefix(CChainParams::PUBKEY_ADDRESS))
|
||||
|
||||
Reference in New Issue
Block a user