Skip to content

Commit

Permalink
Bugfix: Dogecoin network fee calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
doersf committed Nov 13, 2021
1 parent 79aaf83 commit 6e0f1bf
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blockio-basic-multisig-sweep",
"version": "1.1.0",
"version": "1.1.1",
"description": "",
"main": "example.js",
"scripts": {
Expand Down
18 changes: 14 additions & 4 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module.exports = {
P2SH: 'P2SH',
P2WSH: 'WITNESS_V0',
COIN: '100000000',
FEE_RATE: 20, // LTC and BTC, not DOGE
N: 100,
MAX_TX_INPUTS: 500,
BLOCKCHAIN_PROVIDER_DEFAULT: 'sochain',
Expand Down Expand Up @@ -37,18 +36,29 @@ module.exports = {
DOGE: 'DOGE',
DOGETEST: 'DOGETEST'
},
FEE_RATE: {
BTC: 20,
LTC: 20,
DOGE: 2000,
BTCTEST: 20,
LTCTEST: 20,
DOGETEST: 2000
},
DUST: {
BTC: 546,
LTC: 1000,
DOGE: 1000000 // https://github.com/dogecoin/dogecoin/blob/v1.14.5/doc/fee-recommendation.md
DOGE: 1000000, // https://github.com/dogecoin/dogecoin/blob/v1.14.5/doc/fee-recommendation.md
BTCTEST: 546,
LTCTEST: 1000,
DOGETEST: 1000000 // https://github.com/dogecoin/dogecoin/blob/v1.14.5/doc/fee-recommendation.md
},
NETWORK_FEE_MAX: {
BTC: (250 * 100000), // 0.25 BTC
BTCTEST: (250 * 100000), // 0.25 BTCTEST
LTC: (50 * 100000), // 0.05 LTC
LTCTEST: (50 * 100000), // 0.05 LTCTEST
DOGE: (200 * 100000000), // 200 DOGE
DOGETEST: (200 * 100000000) // 200 DOGETEST
DOGE: (2 * 100000000), // 2.00 DOGE
DOGETEST: (2 * 100000000) // 2.00 DOGETEST
},
TX_BROADCAST_APPROVAL_TEXT: 'I have verified this transaction, and I want to broadcast it now'
}
4 changes: 2 additions & 2 deletions src/sweeper.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ function BlockIoSweep (network, bip32_private_key_1, private_key_2, destination_

if (options && typeof (options) === 'object') {
this.provider = options.provider || BlockIoSweep.DEFAULT_BLOCKCHAIN_PROVIDER
this.feeRate = options.feeRate || BlockIoSweep.DEFAULT_FEE_RATE
this.feeRate = options.feeRate || BlockIoSweep.DEFAULT_FEE_RATE[network]
this.maxTxInputs = options.maxTxInputs || BlockIoSweep.DEFAULT_MAX_TX_INPUTS
} else {
this.provider = BlockIoSweep.DEFAULT_BLOCKCHAIN_PROVIDER
this.feeRate = BlockIoSweep.DEFAULT_FEE_RATE
this.feeRate = BlockIoSweep.DEFAULT_FEE_RATE[network]
this.maxTxInputs = BlockIoSweep.DEFAULT_MAX_TX_INPUTS
}
this.providerService = new ProviderService(this.provider, this.network)
Expand Down

0 comments on commit 6e0f1bf

Please sign in to comment.