Skip to content

Commit

Permalink
wallet: add ability to pass r+w function to dogecoin_wallet_load_tran…
Browse files Browse the repository at this point in the history
…ction
  • Loading branch information
xanimo committed Jul 14, 2023
1 parent 251c50b commit cb44cd7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/wallet.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ dogecoin_bool dogecoin_wallet_load_address(dogecoin_wallet* wallet, void (*rw)(v
return true;
}

dogecoin_bool dogecoin_wallet_load_transaction(dogecoin_wallet* wallet, uint32_t reclen) {
dogecoin_bool dogecoin_wallet_load_transaction(dogecoin_wallet* wallet, uint32_t reclen, void (*rw)(void *)) {
if (!wallet) return false;
unsigned char* buf = dogecoin_uchar_vla(reclen);
struct const_buffer cbuf = {buf, reclen};
Expand Down Expand Up @@ -760,7 +760,7 @@ dogecoin_bool dogecoin_wallet_replace(
} else if (rectype == WALLET_DB_REC_TYPE_ADDR) {
if (!dogecoin_wallet_load_address(wallet, NULL)) return false;
} else if (rectype == WALLET_DB_REC_TYPE_TX) {
if (!dogecoin_wallet_load_transaction(wallet, reclen)) return false;
if (!dogecoin_wallet_load_transaction(wallet, reclen, NULL)) return false;
}
}
dogecoin_file_commit(wallet->dbfile);
Expand Down Expand Up @@ -825,7 +825,7 @@ dogecoin_bool dogecoin_wallet_load(dogecoin_wallet* wallet, const char* file_pat
} else if (rectype == WALLET_DB_REC_TYPE_ADDR) {
if (!dogecoin_wallet_load_address(wallet, NULL)) return false;
} else if (rectype == WALLET_DB_REC_TYPE_TX) {
if (!dogecoin_wallet_load_transaction(wallet, reclen)) return false;
if (!dogecoin_wallet_load_transaction(wallet, reclen, NULL)) return false;
} else {
fseek(wallet->dbfile, reclen, SEEK_CUR);
}
Expand Down

0 comments on commit cb44cd7

Please sign in to comment.