Add Sapling transaction support.

This commit is contained in:
Simon 2018-09-17 22:45:57 -07:00
parent 1ab4e2fd55
commit 1803cb983e
1 changed files with 13 additions and 0 deletions

View File

@ -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);
});