diff --git a/wallet/wallet.c b/wallet/wallet.c index c9610fe3d..ff9f44899 100644 --- a/wallet/wallet.c +++ b/wallet/wallet.c @@ -3444,7 +3444,7 @@ static struct wallet_payment *wallet_stmt2payment(const tal_t *ctx, take(db_col_optional(NULL, stmt, "destination", node_id)), db_col_amount_msat(stmt, "msatoshi"), db_col_amount_msat(stmt, "msatoshi_sent"), - db_col_amount_msat(stmt, "total_msat"), + db_col_is_null(stmt, "total_msat") ? AMOUNT_MSAT(0) : db_col_amount_msat(stmt, "total_msat"), take(db_col_optional(NULL, stmt, "payment_preimage", preimage)), take(db_col_secret_arr(NULL, stmt, "path_secrets")), take(db_col_node_id_arr(NULL, stmt, "route_nodes")),