Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ ColoredCoinsBuilder.prototype._addInputsForSendTransaction = function (txb, args
if (coloredChange) {
coloredOutputIndexes.push(txb.tx.outs.length)
}
txb.addOutput(Array.isArray(args.from) ? args.from[0] : args.from, lastOutputValue)
txb.addOutput(changeAddress, lastOutputValue)
debug('success')
return { txHex: txb.tx.toHex(), metadataSha1: args.torrentHash, multisigOutputs: reedemScripts, coloredOutputIndexes: _.uniqBy(coloredOutputIndexes) }
}
Expand Down
2 changes: 1 addition & 1 deletion modules/findBestMatchByNeededAssets.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var findBestMatchByNeededAssets = function (utxos, assetList, key, txb, inputval
debug('adding input')
var inputIndex = txb.tx.ins.length
if (!txb.tx.ins.some(function (txutxo, i) {
if (txutxo.index === utxo.index && bitcoinjs.bufferutils.reverse(txutxo.hash).toString('hex') === utxo.txid) {
if (txutxo.index === utxo.index && txutxo.hash.toString('hex').split('').reverse().join('') === utxo.txid) {
debug('more assets in same utxo')
inputIndex = i
return true
Expand Down