log failures of balance transfers

master
Jethro Grassie 5 years ago
parent af9b9c8953
commit 6471c6a20a
No known key found for this signature in database
GPG Key ID: DE8ED755616565BB

@ -1729,9 +1729,9 @@ rpc_on_wallet_transferred(const char* data, rpc_callback_t *callback)
int ec = json_object_get_int(code); int ec = json_object_get_int(code);
const char *em = json_object_get_string(message); const char *em = json_object_get_string(message);
log_error("Error (%d) with wallet transfer: %s", ec, em); log_error("Error (%d) with wallet transfer: %s", ec, em);
goto cleanup;
} }
log_info("Payout transfer successfull"); else
log_info("Payout transfer successfull");
int rc; int rc;
char *err; char *err;
@ -1772,6 +1772,11 @@ rpc_on_wallet_transferred(const char* data, rpc_callback_t *callback)
} }
uint64_t current_amount = *(uint64_t*)val.mv_data; uint64_t current_amount = *(uint64_t*)val.mv_data;
current_amount -= payment->amount; current_amount -= payment->amount;
if (error)
{
log_warn("Error seen on transfer for %s with amount %"PRIu64,
payment->address, payment->amount);
}
MDB_val new_val = {sizeof(current_amount), (void*)&current_amount}; MDB_val new_val = {sizeof(current_amount), (void*)&current_amount};
rc = mdb_cursor_put(cursor, &key, &new_val, MDB_CURRENT); rc = mdb_cursor_put(cursor, &key, &new_val, MDB_CURRENT);
if (rc != 0) if (rc != 0)

Loading…
Cancel
Save