diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2018-05-17 22:07:32 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2018-05-18 14:20:10 +0200 |
commit | 5d8de762579424d32c437bc3a7695d25e482c200 (patch) | |
tree | 0b65bca35b7e45ad7f02faece080629a3b46a0b4 | |
parent | feba12fe85e89a1cdd6a022872d73fd6e7b307a9 (diff) |
wallet: Exit SyncMetaData if there are no transactions to sync
Instead of crash with an assertion error, simply exit the function
`SyncMetaData` if there is no metadata to sync.
Fixes #13110.
Github-Pull: #13265
Rebased-From: b0d2ca9fb66d793e3c0f2e6ede811f1b16c33a9f
Tree-SHA512: 67e446e9ced901e37003a9661b6abea268e2ea648ac3b076d91c8d996de96bed389839a09d579a6562d930bcf501a091eb67454f474aae1174108a8650502072
-rw-r--r-- | src/wallet/wallet.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 2b8019395c..468d704111 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -539,7 +539,9 @@ void CWallet::SyncMetaData(std::pair<TxSpends::iterator, TxSpends::iterator> ran } } - assert(copyFrom); + if (!copyFrom) { + return; + } // Now copy data from copyFrom to rest: for (TxSpends::iterator it = range.first; it != range.second; ++it) |