mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Fix: make CCoinsViewDbCursor::Seek work for missing keys
Thanks to Suhas Daftuar for figuring this out.
This commit is contained in:
parent
4cb8757aae
commit
822755a424
1 changed files with 5 additions and 1 deletions
|
|
@ -98,7 +98,11 @@ CCoinsViewCursor *CCoinsViewDB::Cursor() const
|
|||
that restriction. */
|
||||
i->pcursor->Seek(DB_COINS);
|
||||
// Cache key of first record
|
||||
i->pcursor->GetKey(i->keyTmp);
|
||||
if (i->pcursor->Valid()) {
|
||||
i->pcursor->GetKey(i->keyTmp);
|
||||
} else {
|
||||
i->keyTmp.first = 0; // Make sure Valid() and GetKey() return false
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue