Browse Source

fix: Do not assume size_t == u64

This was causing some compilation trouble on 32bit systems, see #256.

Reported-by: @shsmith
Signed-off-by: Christian Decker <decker.christian@gmail.com>
ppa-0.6.1
Christian Decker 8 years ago
parent
commit
4b59c4f857
  1. 2
      onchaind/onchain.c
  2. 2
      wallet/wallet.c

2
onchaind/onchain.c

@ -1286,7 +1286,7 @@ int main(int argc, char *argv[])
status_failed(WIRE_ONCHAIN_BAD_COMMAND,
"Can't allocate %"PRIu64" htlcs", num_htlcs);
for (size_t i = 0; i < num_htlcs; i++) {
for (u64 i = 0; i < num_htlcs; i++) {
msg = wire_sync_read(ctx, REQ_FD);
if (!msg || !fromwire_onchain_htlc(msg, NULL, &htlcs[i]))
status_failed(WIRE_ONCHAIN_BAD_COMMAND,

2
wallet/wallet.c

@ -31,7 +31,7 @@ bool wallet_add_utxo(struct wallet *w, struct utxo *utxo,
bool result = db_exec(
__func__, w->db,
"INSERT INTO outputs (prev_out_tx, prev_out_index, value, type, "
"status, keyindex) VALUES ('%s', %d, %zu, %d, %d, %d);",
"status, keyindex) VALUES ('%s', %d, %"PRIu64", %d, %d, %d);",
hextxid, utxo->outnum, utxo->amount, type, output_state_available,
utxo->keyindex);
tal_free(tmpctx);

Loading…
Cancel
Save