network: testnet should use testnet
This commit is contained in:
parent
9e2e0bd01a
commit
77b68a52a6
1 changed files with 3 additions and 3 deletions
|
@ -54,7 +54,7 @@ var networks = {
|
||||||
wif: 0xef,
|
wif: 0xef,
|
||||||
dustThreshold: 546,
|
dustThreshold: 546,
|
||||||
feePerKb: 10000,
|
feePerKb: 10000,
|
||||||
estimateFee: estimateFee('bitcoin')
|
estimateFee: estimateFee('testnet')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,10 +65,10 @@ function estimateFee(type) {
|
||||||
var byteSize = tx.toBuffer().length
|
var byteSize = tx.toBuffer().length
|
||||||
|
|
||||||
var fee = baseFee * Math.ceil(byteSize / 1000)
|
var fee = baseFee * Math.ceil(byteSize / 1000)
|
||||||
if(network.dustSoftThreshold == undefined) return fee
|
if (network.dustSoftThreshold == undefined) return fee
|
||||||
|
|
||||||
tx.outs.forEach(function(e){
|
tx.outs.forEach(function(e){
|
||||||
if(e.value < network.dustSoftThreshold) {
|
if (e.value < network.dustSoftThreshold) {
|
||||||
fee += baseFee
|
fee += baseFee
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Reference in a new issue