From 1803cb983e6350a425fac01412199c25ff47c5bd Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 17 Sep 2018 22:45:57 -0700 Subject: [PATCH] Add Sapling transaction support. --- lib/services/bitcoind.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/services/bitcoind.js b/lib/services/bitcoind.js index 4108b8ef..3ffdc225 100644 --- a/lib/services/bitcoind.js +++ b/lib/services/bitcoind.js @@ -2006,6 +2006,19 @@ Bitcoin.prototype.getDetailedTransaction = function(txid, callback) { tx.nExpiryHeight = result.expiryheight; } + // Sapling START + if (tx.fOverwintered && tx.version >= 4) { + tx.valueBalance = result.valueBalance; + tx.spendDescs = result.vShieldedSpend; + tx.outputDescs = result.vShieldedOutput; + if (result.bindingSig) { + tx.bindingSig = result.bindingSig; + } + // Update tx.feeSatoshis with custom explorer JSON field 'valueBalanceZat' + tx.feeSatoshis = tx.feeSatoshis + result.valueBalanceZat; + } + // Sapling END + self.transactionDetailedCache.set(txid, tx); done(null, tx); });