IsUsedDestination shouldn't use key id as script id for ScriptHash

Github-Pull: #17924
Rebased-From: 4b8f1e989f3b969dc628b0801d5c31ebd373719c
This commit is contained in:
Gregory Sanders 2020-01-14 13:23:24 -05:00 committed by João Barbosa
parent a5489c9892
commit e2c45d89f7

View file

@ -1087,7 +1087,7 @@ bool CWallet::IsUsedDestination(const uint256& hash, unsigned int n) const
if (GetDestData(wpkh_dest, "used", nullptr)) {
return true;
}
ScriptHash sh_wpkh_dest(wpkh_dest);
ScriptHash sh_wpkh_dest(GetScriptForDestination(wpkh_dest));
if (GetDestData(sh_wpkh_dest, "used", nullptr)) {
return true;
}