Transaction: remove estimateFee
This is a wallet abstraction.
This commit is contained in:
parent
009fcb9b82
commit
d567463588
3 changed files with 5 additions and 36 deletions
src
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue