@ -1218,8 +1218,29 @@ shepherd.get('/electrum/listtransactions', function(req, res, next) {
const formattedTx = shepherd . parseTransactionAddresses ( _ parsedTx , req . query . address , network ) ;
const formattedTx = shepherd . parseTransactionAddresses ( _ parsedTx , req . query . address , network ) ;
if ( formattedTx . type ) {
if ( formattedTx . type ) {
formattedTx . height = transaction . height ;
formattedTx . blocktime = blockInfo . timestamp ;
formattedTx . timereceived = blockInfo . timereceived ;
formattedTx . hex = _ rawtxJSON ;
formattedTx . inputs = decodedTx . inputs ;
formattedTx . outputs = decodedTx . outputs ;
formattedTx . locktime = decodedTx . format . locktime ;
_ rawtx . push ( formattedTx ) ;
_ rawtx . push ( formattedTx ) ;
} else {
} else {
formattedTx [ 0 ] . height = transaction . height ;
formattedTx [ 0 ] . blocktime = blockInfo . timestamp ;
formattedTx [ 0 ] . timereceived = blockInfo . timereceived ;
formattedTx [ 0 ] . hex = _ rawtxJSON ;
formattedTx [ 0 ] . inputs = decodedTx . inputs ;
formattedTx [ 0 ] . outputs = decodedTx . outputs ;
formattedTx [ 0 ] . locktime = decodedTx . format . locktime ;
formattedTx [ 1 ] . height = transaction . height ;
formattedTx [ 1 ] . blocktime = blockInfo . timestamp ;
formattedTx [ 1 ] . timereceived = blockInfo . timereceived ;
formattedTx [ 1 ] . hex = _ rawtxJSON ;
formattedTx [ 1 ] . inputs = decodedTx . inputs ;
formattedTx [ 1 ] . outputs = decodedTx . outputs ;
formattedTx [ 1 ] . locktime = decodedTx . format . locktime ;
_ rawtx . push ( formattedTx [ 0 ] ) ;
_ rawtx . push ( formattedTx [ 0 ] ) ;
_ rawtx . push ( formattedTx [ 1 ] ) ;
_ rawtx . push ( formattedTx [ 1 ] ) ;
}
}
@ -1290,7 +1311,8 @@ shepherd.get('/electrum/listtransactions', function(req, res, next) {
} ) ;
} ) ;
shepherd . get ( '/electrum/gettransaction' , function ( req , res , next ) {
shepherd . get ( '/electrum/gettransaction' , function ( req , res , next ) {
const ecl = new electrumJSCore ( electrumServers [ req . query . network ] . port , electrumServers [ req . query . network ] . address , electrumServers [ req . query . network ] . proto ) ; // tcp or tls
const network = req . query . network || shepherd . findNetworkObj ( req . query . coin ) ;
const ecl = new electrumJSCore ( electrumServers [ network ] . port , electrumServers [ network ] . address , electrumServers [ network ] . proto ) ; // tcp or tls
ecl . connect ( ) ;
ecl . connect ( ) ;
ecl . blockchainTransactionGet ( req . query . txid )
ecl . blockchainTransactionGet ( req . query . txid )