mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 04:22:55 +01:00
instantsend: make sure islocks we read from db are the ones we expected (#4663)
fallback to the legacy version and then to nullptr
This commit is contained in:
parent
4f3c2492eb
commit
aa1165b697
@ -326,10 +326,10 @@ CInstantSendLockPtr CInstantSendDb::GetInstantSendLockByHash(const uint256& hash
|
|||||||
|
|
||||||
ret = std::make_shared<CInstantSendLock>(CInstantSendLock::isdlock_version);
|
ret = std::make_shared<CInstantSendLock>(CInstantSendLock::isdlock_version);
|
||||||
bool exists = db->Read(std::make_tuple(DB_ISLOCK_BY_HASH, hash), *ret);
|
bool exists = db->Read(std::make_tuple(DB_ISLOCK_BY_HASH, hash), *ret);
|
||||||
if (!exists) {
|
if (!exists || (::SerializeHash(*ret) != hash)) {
|
||||||
ret = std::make_shared<CInstantSendLock>();
|
ret = std::make_shared<CInstantSendLock>();
|
||||||
exists = db->Read(std::make_tuple(DB_ISLOCK_BY_HASH, hash), *ret);
|
exists = db->Read(std::make_tuple(DB_ISLOCK_BY_HASH, hash), *ret);
|
||||||
if (!exists) {
|
if (!exists || (::SerializeHash(*ret) != hash)) {
|
||||||
ret = nullptr;
|
ret = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user