From 7865b4a679ccf7e0cccdab7458527671e0e2e311 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Thu, 11 Jan 2018 23:57:51 +0100 Subject: [PATCH] wallet: Use int64 when deserializing output value from db We were using int32 for msatoshi values for outputs, which would overflow for values larger than 2^32. Signed-off-by: Christian Decker --- wallet/wallet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wallet/wallet.c b/wallet/wallet.c index 07dbd9cb2..123a4fb83 100644 --- a/wallet/wallet.c +++ b/wallet/wallet.c @@ -57,7 +57,7 @@ static bool wallet_stmt2output(sqlite3_stmt *stmt, struct utxo *utxo) { sqlite3_column_sha256_double(stmt, 0, &utxo->txid.shad); utxo->outnum = sqlite3_column_int(stmt, 1); - utxo->amount = sqlite3_column_int(stmt, 2); + utxo->amount = sqlite3_column_int64(stmt, 2); utxo->is_p2sh = sqlite3_column_int(stmt, 3) == p2sh_wpkh; utxo->status = sqlite3_column_int(stmt, 4); utxo->keyindex = sqlite3_column_int(stmt, 5);