From 4da9cd32c42c3a5a756e39dfaf561231c4950ad7 Mon Sep 17 00:00:00 2001 From: Rabbit Date: Wed, 4 Sep 2024 09:27:23 +0800 Subject: [PATCH] chore: filter bitcoin vouts in binding status (#2173) --- app/controllers/api/v2/bitcoin_addresses_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/v2/bitcoin_addresses_controller.rb b/app/controllers/api/v2/bitcoin_addresses_controller.rb index f2ba1b5de..da7140337 100644 --- a/app/controllers/api/v2/bitcoin_addresses_controller.rb +++ b/app/controllers/api/v2/bitcoin_addresses_controller.rb @@ -53,7 +53,7 @@ def udt_accounts cell_types = %w(udt xudt xudt_compatible) cell_outputs = CellOutput.live.includes(:bitcoin_vout).where(cell_outputs: { address_id: address_ids, cell_type: cell_types }). - where.not(bitcoin_vouts: { status: "unbound" }).group(:cell_type, :type_hash).sum(:udt_amount) + where.not(bitcoin_vouts: { status: ["unbound", "binding"] }).group(:cell_type, :type_hash).sum(:udt_amount) udt_accounts = cell_outputs.map do |k, v| udt = Udt.find_by(type_hash: k[1], published: true)