Skip to content

Commit

Permalink
fix(BCH - Split): Add additional input/output after original selection
Browse files Browse the repository at this point in the history
  • Loading branch information
plondon committed Nov 21, 2018
1 parent 9347ab5 commit b2419fb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
20 changes: 3 additions & 17 deletions packages/blockchain-wallet-v4/src/network/api/bch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,24 +66,10 @@ export default ({ rootUrl, apiUrl, get, post }) => {
})

const getBchDust = () =>
Promise.resolve({
tx_hash:
'fd208b67abd52eb417cce9a1886f29342e3577a4d1f9c87fbb11ca21e6fc3a81',
tx_hash_big_endian:
'813afce621ca11bb7fc8f9d1a477352e34296f88a1e9cc17b42ed5ab678b20fd',
tx_index: 0,
tx_output_n: 26,
script: '00',
value: 546,
value_hex: '00000222',
confirmations: 1,
output_script: '76a914757666a692b3676fef9df7d0f61d415012555f6288ac',
lock_secret: 'b812995e2ca64c69bdd9187f2c26ab3b'
get({
url: apiUrl,
endPoint: '/dust'
})
// get({
// url: apiUrl,
// endpoint: '/bch/dust'
// })

return {
fetchBchData,
Expand Down
4 changes: 2 additions & 2 deletions packages/blockchain-wallet-v4/src/signer/bch.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ export const signSelection = curry((network, coinDust, selection) => {
coin.value
)
const sign = (coin, i) => tx.sign(i, coin.priv, null, hashType, coin.value)
forEach(addInput, selection.inputs)
forEach(addOutput, selection.outputs)
tx.addInput(
coinDust.txHash,
coinDust.index,
BitcoinCash.Transaction.DEFAULT_SEQUENCE
)
tx.addOutput(coinDust.address, coinDust.value)
forEach(addInput, selection.inputs)
forEach(addOutput, selection.outputs)
addIndex(forEach)(sign, selection.inputs)
const signedTx = tx.buildIncomplete()
return { txHex: signedTx.toHex(), txId: signedTx.getId() }
Expand Down

0 comments on commit b2419fb

Please sign in to comment.