From 312ee7985bb90e7379455831a88e66c70e06112a Mon Sep 17 00:00:00 2001 From: alexqrid Date: Sun, 19 Jul 2026 10:01:40 +0300 Subject: [PATCH] add ironwood pool processing --- Modules/Common/UTXOMainModule.php | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Modules/Common/UTXOMainModule.php b/Modules/Common/UTXOMainModule.php index 2ae742c..f3f67c4 100644 --- a/Modules/Common/UTXOMainModule.php +++ b/Modules/Common/UTXOMainModule.php @@ -233,7 +233,8 @@ final public function pre_process_block($block_id) count($transaction['vout']) + (int)(isset($transaction['vjoinsplit']) && $transaction['vjoinsplit']) + (int)((isset($transaction['vShieldedSpend']) && $transaction['vShieldedSpend']) || (isset($transaction['vShieldedOutput']) && $transaction['vShieldedOutput'])) + - (int)(isset($transaction['orchard']) && $transaction['orchard'] && $transaction['orchard']['actions']) + (int)(isset($transaction['orchard']) && $transaction['orchard'] && $transaction['orchard']['actions']) + + (int)(isset($transaction['ironwood']) && $transaction['ironwood'] && $transaction['ironwood']['actions']) ) === 0 ) throw new ModuleError("No events for transaction {$transaction['txid']}"); @@ -281,6 +282,19 @@ final public function pre_process_block($block_id) $fees[($transaction['txid'])] = bcadd($fees[($transaction['txid'])], $transaction['orchard']['valueBalanceZat']); } + + // Ironwood (NU6.3 successor to Orchard, built on revised Orchard code) + + if (isset($transaction['ironwood']) && $transaction['ironwood'] && $transaction['ironwood']['actions']) + { + $events[] = ['transaction' => $transaction['txid'], + 'address' => 'ironwood-pool', + 'effect' => bcmul('-1', $transaction['ironwood']['valueBalanceZat']), + 'sort_in_transaction' => PHP_INT_MAX - 1, + ]; + + $fees[($transaction['txid'])] = bcadd($fees[($transaction['txid'])], $transaction['ironwood']['valueBalanceZat']); + } } $sort_in_block_lib[($transaction['txid'])] = $block_n; @@ -433,7 +447,7 @@ final public function pre_process_block($block_id) if (in_array(UTXOSpecialFeatures::HasShieldedPools, $this->extra_features) && $block_id !== MEMPOOL) { $delta_pools = []; - $this_pools = ['transparent' => '0', 'sprout' => '0', 'sapling' => '0', 'orchard' => '0', 'lockbox' => '0']; + $this_pools = ['transparent' => '0', 'sprout' => '0', 'sapling' => '0', 'orchard' => '0', 'ironwood' => '0', 'lockbox' => '0']; foreach ($block['valuePools'] as $pool) $delta_pools[($pool['id'])] = $pool['valueDeltaZat']; @@ -448,6 +462,8 @@ final public function pre_process_block($block_id) $this_pools['sapling'] = bcadd($this_pools['sapling'], $event['effect']); if ($event['address'] === 'orchard-pool') $this_pools['orchard'] = bcadd($this_pools['orchard'], $event['effect']); + if ($event['address'] === 'ironwood-pool') + $this_pools['ironwood'] = bcadd($this_pools['ironwood'], $event['effect']); if ($event['address'] === 'lockbox') $this_pools['lockbox'] = bcadd($this_pools['lockbox'], $event['effect']); } @@ -455,6 +471,7 @@ final public function pre_process_block($block_id) $this_pools['transparent'] = bcsub($this_pools['transparent'], $this_pools['sprout']); $this_pools['transparent'] = bcsub($this_pools['transparent'], $this_pools['sapling']); $this_pools['transparent'] = bcsub($this_pools['transparent'], $this_pools['orchard']); + $this_pools['transparent'] = bcsub($this_pools['transparent'], $this_pools['ironwood']); $this_pools['transparent'] = bcsub($this_pools['transparent'], $this_pools['lockbox']); // Check if the coinbase value is correct