add err field to ctx_list.
This commit is contained in:
parent
af58fbff27
commit
9182f5b3b2
|
@ -464,6 +464,7 @@ typedef struct _ctx_list {
|
||||||
CTransaction ctx;
|
CTransaction ctx;
|
||||||
uint256 blockhash;
|
uint256 blockhash;
|
||||||
struct _ctx_list *next;
|
struct _ctx_list *next;
|
||||||
|
std::string err;
|
||||||
} ctx_list;
|
} ctx_list;
|
||||||
|
|
||||||
struct async_addrtx_data {
|
struct async_addrtx_data {
|
||||||
|
@ -2061,6 +2062,10 @@ done:
|
||||||
return;
|
return;
|
||||||
#else
|
#else
|
||||||
ctx_list *ctxs = read_addr(data->addr);
|
ctx_list *ctxs = read_addr(data->addr);
|
||||||
|
if (!ctxs->err.empty()) {
|
||||||
|
data->err_msg = ctxs->err;
|
||||||
|
return;
|
||||||
|
}
|
||||||
data->ctxs = ctxs;
|
data->ctxs = ctxs;
|
||||||
if (data->ctxs == NULL) {
|
if (data->ctxs == NULL) {
|
||||||
data->err_msg = std::string("Could not read database.");
|
data->err_msg = std::string("Could not read database.");
|
||||||
|
@ -5870,6 +5875,8 @@ read_addr(const std::string addr) {
|
||||||
ctx_list *head = new ctx_list();
|
ctx_list *head = new ctx_list();
|
||||||
ctx_list *cur = NULL;
|
ctx_list *cur = NULL;
|
||||||
|
|
||||||
|
head->err = std::string("");
|
||||||
|
|
||||||
CScript expectedScriptSig = GetScriptForDestination(CBitcoinAddress(addr).Get());
|
CScript expectedScriptSig = GetScriptForDestination(CBitcoinAddress(addr).Get());
|
||||||
|
|
||||||
leveldb::Iterator* pcursor = pblocktree->pdb->NewIterator(pblocktree->iteroptions);
|
leveldb::Iterator* pcursor = pblocktree->pdb->NewIterator(pblocktree->iteroptions);
|
||||||
|
@ -5944,9 +5951,10 @@ read_addr(const std::string addr) {
|
||||||
found:
|
found:
|
||||||
pcursor->Next();
|
pcursor->Next();
|
||||||
} catch (std::exception &e) {
|
} catch (std::exception &e) {
|
||||||
// error("%s : Deserialize or I/O error - %s", __func__, e.what());
|
throw error("%s : Deserialize or I/O error - %s", __func__, e.what());
|
||||||
delete pcursor;
|
// head->err = std::string("LevelDB Error");
|
||||||
return head;
|
// delete pcursor;
|
||||||
|
// return head;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue