Transaction: remove estimateFee

This is a wallet abstraction.
This commit is contained in:
Daniel Cousens 2014-06-13 17:00:40 +10:00
parent 009fcb9b82
commit d567463588
3 changed files with 5 additions and 36 deletions

View file

@ -237,10 +237,13 @@ function Wallet(seed, network) {
return sortByValueDesc
}
function estimateFeePadChangeOutput(tx){
var feePerKb = 20000
function estimateFeePadChangeOutput(tx) {
var tmpTx = tx.clone()
tmpTx.addOutput(getChangeAddress(), 0)
return tmpTx.estimateFee()
var byteSize = tmpTx.toBuffer().length
return feePerKb * Math.ceil(byteSize / 1000)
}
function getChangeAddress() {