From d865ad68e0b45ec65fcf525aeb93b9abe2f95a16 Mon Sep 17 00:00:00 2001 From: Roy Keene Date: Sat, 18 Aug 2018 15:19:20 -0500 Subject: [PATCH] Update to use strongly typed iterators --- rai/node/wallet.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rai/node/wallet.cpp b/rai/node/wallet.cpp index a4bc2341..797c50f3 100644 --- a/rai/node/wallet.cpp +++ b/rai/node/wallet.cpp @@ -718,14 +718,15 @@ void rai::wallet_store::upgrade_v3_v4 () case rai::key_type::adhoc: { rai::raw_key key; - if (fetch (transaction, i->first.uint256 (), key)) + if (fetch (transaction, rai::public_key (i->first), key)) { // Key failed to decrypt despite valid password key.decrypt (value.key, password_l, salt (transaction).owords[0]); rai::uint256_union new_key_ciphertext; - new_key_ciphertext.encrypt (key, password_l, i->first.uint256 ().owords[0].number ()); + new_key_ciphertext.encrypt (key, password_l, (rai::uint256_union (i->first)).owords[0].number ()); rai::wallet_value new_value (new_key_ciphertext, value.work); - mdb_cursor_put (i.cursor, i->first, new_value.val (), MDB_CURRENT); + erase (transaction, rai::public_key (i->first)); + entry_put_raw (transaction, rai::public_key (i->first), new_value); } } case rai::key_type::deterministic: