diff --git a/src/addresstype.cpp b/src/addresstype.cpp index f199d1b479..3f7b3c6527 100644 --- a/src/addresstype.cpp +++ b/src/addresstype.cpp @@ -54,12 +54,24 @@ bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet) switch (whichType) { case TxoutType::PUBKEY: { CPubKey pubKey(vSolutions[0]); + + /* if (!pubKey.IsValid()) { addressRet = CNoDestination(scriptPubKey); } else { addressRet = PubKeyDestination(pubKey); } return false; + */ + + // Blackcoin: Reinterpret P2PK scripts as PKHash + // We need to do that because proof-of-stake mechanism uses P2PK outputs + // It partially reverts Bitcoin Core PR#28246 https://github.com/bitcoin/bitcoin/pull/28246 + if (!pubKey.IsValid()) + return false; + + addressRet = PKHash(pubKey); + return true; } case TxoutType::PUBKEYHASH: { addressRet = PKHash(uint160(vSolutions[0]));