add async version of createTx
This commit is contained in:
parent
f7d4895b74
commit
68b08b638a
2 changed files with 60 additions and 0 deletions
src
|
@ -200,6 +200,22 @@ var Wallet = function (seed, options) {
|
|||
return tx
|
||||
}
|
||||
|
||||
this.createTxAsync = function(to, value, fixedFee, callback){
|
||||
if(fixedFee instanceof Function) {
|
||||
callback = fixedFee
|
||||
fixedFee = undefined
|
||||
}
|
||||
var tx = null
|
||||
|
||||
try {
|
||||
tx = this.createTx(to, value, fixedFee)
|
||||
} catch(err) {
|
||||
return callback(err)
|
||||
}
|
||||
|
||||
callback(null, tx)
|
||||
}
|
||||
|
||||
this.dustThreshold = 5430
|
||||
function isDust(amount) {
|
||||
return amount <= me.dustThreshold
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue