From 83bf984ca266ad448095a508c7eddcb22ac4b420 Mon Sep 17 00:00:00 2001 From: Donald Adu-Poku Date: Tue, 13 Aug 2019 16:30:21 +0000 Subject: [PATCH] multi: store unencrypted scripts in address mgr. This allows storing unencrypted script addresses in the address manager. This behaviour will become default after the wallet is upgraded. --- wallet/udb/addressdb.go | 66 +++++++++++++++++------------ wallet/udb/addressmanager.go | 56 ++++++++++--------------- wallet/udb/upgrades.go | 80 +++++++++++++++++++++++++++++++++++- wallet/udb/upgrades_test.go | 33 +++++++++++++++ 4 files changed, 174 insertions(+), 61 deletions(-) diff --git a/wallet/udb/addressdb.go b/wallet/udb/addressdb.go index da323b4b1..daf6d2bfe 100644 --- a/wallet/udb/addressdb.go +++ b/wallet/udb/addressdb.go @@ -108,8 +108,9 @@ type dbImportedAddressRow struct { // address in the database. type dbScriptAddressRow struct { dbAddressRow - encryptedHash []byte - encryptedScript []byte + hash []byte + script []byte + encrypted bool } // Key names for various database fields. @@ -968,15 +969,16 @@ func serializeImportedAddress(encryptedPubKey, encryptedPrivKey []byte) []byte { // row as a script address. func deserializeScriptAddress(row *dbAddressRow) (*dbScriptAddressRow, error) { // The serialized script address raw data format is: - // + //