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
This commit is contained in:
Wladimir J. van der Laan 2018-05-17 22:07:32 +02:00
parent feba12fe85
commit 5d8de76257
No known key found for this signature in database
GPG Key ID: 1E4AED62986CD25D

View File

@ -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)