mirror of
https://git.wownero.com/wownero/wownero-puddle.git
synced 2024-08-15 01:03:20 +00:00
fix balance updates
This commit is contained in:
parent
4d69befdd1
commit
2c636d00e9
1 changed files with 8 additions and 1 deletions
|
@ -572,7 +572,12 @@ balance_add(const char *address, uint64_t amount, MDB_txn *parent)
|
||||||
{
|
{
|
||||||
log_trace("Adding new balance entry");
|
log_trace("Adding new balance entry");
|
||||||
MDB_val new_val = { sizeof(amount), (void*)&amount };
|
MDB_val new_val = { sizeof(amount), (void*)&amount };
|
||||||
mdb_cursor_put(cursor, &key, &new_val, MDB_APPEND);
|
rc = mdb_cursor_put(cursor, &key, &new_val, 0);
|
||||||
|
if (rc != 0)
|
||||||
|
{
|
||||||
|
err = mdb_strerror(rc);
|
||||||
|
log_error("%s", err);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (rc == 0)
|
else if (rc == 0)
|
||||||
{
|
{
|
||||||
|
@ -663,6 +668,8 @@ payout_block(block_t *block, MDB_txn *parent)
|
||||||
rc = balance_add(share->address, amount, txn);
|
rc = balance_add(share->address, amount, txn);
|
||||||
if (rc != 0)
|
if (rc != 0)
|
||||||
{
|
{
|
||||||
|
err = mdb_strerror(rc);
|
||||||
|
log_error("%s", err);
|
||||||
mdb_cursor_close(cursor);
|
mdb_cursor_close(cursor);
|
||||||
mdb_txn_abort(txn);
|
mdb_txn_abort(txn);
|
||||||
return rc;
|
return rc;
|
||||||
|
|
Loading…
Reference in a new issue