fix(wallet) fix scan of default NULL multi_transactions.*_network_id

This commit is contained in:
Stefan 2023-07-11 22:40:58 +01:00 committed by Stefan Dunca
parent 23492467b9
commit 69412cf3a3
1 changed files with 2 additions and 1 deletions

View File

@ -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