diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2017-05-26 11:56:52 -0700 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2017-05-26 13:20:35 -0700 |
commit | b4b057a3e0712dd16b50cbcfe7d613e4413ffa1c (patch) | |
tree | f0b193939e21749a5398d0bc8efdc994f1e2825b /src | |
parent | b40ceed98a112f4f0d07351ce07270d9ff2bf796 (diff) | |
parent | 513da90cdd8463964e8c430b25f4326defc0bc96 (diff) |
Merge #10445: Add test for empty chain and reorg consistency for gettxoutsetinfo.
513da90cd Add test for empty chain and reorg consistency for gettxoutsetinfo. (Gregory Maxwell)
822755a42 Fix: make CCoinsViewDbCursor::Seek work for missing keys (Pieter Wuille)
Tree-SHA512: e549921e8b8f599bf61ebe0ee7ef1d2f474043723d633e24665fe434b996a98e039612de8a1c2cd16b63f154943ff5ea1c1935e9561cfb813a00d47d926d0b22
Diffstat (limited to 'src')
-rw-r--r-- | src/txdb.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/txdb.cpp b/src/txdb.cpp index 42dc31760b..76aab23983 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -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; } |