From 69412cf3a3941feec1babdf88c761600977a2b83 Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 11 Jul 2023 22:40:58 +0100 Subject: [PATCH] fix(wallet) fix scan of default NULL multi_transactions.*_network_id --- services/wallet/transfer/transaction.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/wallet/transfer/transaction.go b/services/wallet/transfer/transaction.go index 952c23f62..c2c9ec25b 100644 --- a/services/wallet/transfer/transaction.go +++ b/services/wallet/transfer/transaction.go @@ -113,6 +113,7 @@ type TransactionIdentity struct { } const multiTransactionColumns = "from_network_id, from_tx_hash, from_address, from_asset, from_amount, to_network_id, to_tx_hash, to_address, to_asset, to_amount, type, cross_tx_id, timestamp" +const selectMultiTransactionColumns = "COALESCE(from_network_id, 0), from_tx_hash, from_address, from_asset, from_amount, COALESCE(to_network_id, 0), to_tx_hash, to_address, to_asset, to_amount, type, cross_tx_id, timestamp" func rowsToMultiTransactions(rows *sql.Rows) ([]*MultiTransaction, error) { var multiTransactions []*MultiTransaction @@ -381,7 +382,7 @@ func (tm *TransactionManager) GetMultiTransactions(ctx context.Context, ids []Mu stmt, err := tm.db.Prepare(fmt.Sprintf(`SELECT rowid, %s FROM multi_transactions WHERE rowid in (%s)`, - multiTransactionColumns, + selectMultiTransactionColumns, strings.Join(placeholders, ","))) if err != nil { return nil, err