pub fn orchard_value_balance_non_negative(
tx: &Transaction,
network_upgrade: NetworkUpgrade,
) -> Result<(), TransactionError>Expand description
Checks that no net new value is shielded into the Orchard pool from NU6.3 onward.
§Consensus
[NU6.3 onward]
valueBalanceOrchardMUST be nonnegative.
https://zips.z.cash/protocol/protocol.pdf#txnconsensus
From NU6.3, newly shielded value is routed to the Ironwood pool, so the Orchard pool is frozen
against new inflows. An Orchard bundle may still spend existing notes — Orchard-to-Orchard note
management nets to a zero balance and Orchard-to-transparent unshielding to a positive one — but
a net-negative valueBalanceOrchard (which would move new value into the pool) is rejected.
This applies to both v5 and v6 Orchard bundles, since v5 Orchard bundles remain valid after NU6.3 (so that non-upgraded hardware wallets can keep authorizing Orchard spends).
(No-op for transactions without an Orchard bundle, and before NU6.3.)