Skip to content

Commit

Permalink
Add code missed in merge, compiles
Browse files Browse the repository at this point in the history
  • Loading branch information
metalicjames committed Sep 23, 2017
1 parent 36c96e3 commit cce3608
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cmd/vtcatomicswap/main.go
Expand Up @@ -428,7 +428,7 @@ func fundRawTransaction(c *rpc.Client, tx *wire.MsgTx, feePerKb vtcutil.Amount)
// the minimum mempool relay fee. It first tries to get the user-set fee in the
// wallet. If unset, it attempts to find an estimate using estimatefee 6. If
// both of these fail, it falls back to mempool relay fee policy.
func getFeePerKb(c *rpc.Client) (useFee, relayFee ltcutil.Amount, err error) {
func getFeePerKb(c *rpc.Client) (useFee, relayFee vtcutil.Amount, err error) {
info, err := c.GetInfo()
if err != nil {
return 0, 0, fmt.Errorf("getinfo: %v", err)
Expand Down Expand Up @@ -566,7 +566,7 @@ func buildContract(c *rpc.Client, args *contractArgs) (*builtContract, error) {
return nil, err
}

feePerKb, err := getFeePerKb(c)
feePerKb, minFeePerKb, err := getFeePerKb(c)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -609,7 +609,7 @@ func buildContract(c *rpc.Client, args *contractArgs) (*builtContract, error) {
refundSize := estimateRefundSerializeSize(contract, refundTx.TxOut)
refundFee := txrules.FeeForSerializeSize(feePerKb, refundSize)
refundTx.TxOut[0].Value = int64(args.amount - refundFee)
if txrules.IsDustOutput(refundTx.TxOut[0], feePerKb) {
if txrules.IsDustOutput(refundTx.TxOut[0], minFeePerKb) {
return nil, fmt.Errorf("refund output value of %v is dust", vtcutil.Amount(refundTx.TxOut[0].Value))
}

Expand Down Expand Up @@ -786,7 +786,7 @@ func (cmd *redeemCmd) runCommand(c *rpc.Client) error {
Index: uint32(contractOut),
}

feePerKb, err := getFeePerKb(c)
feePerKb, minFeePerKb, err := getFeePerKb(c)
if err != nil {
return err
}
Expand All @@ -798,7 +798,7 @@ func (cmd *redeemCmd) runCommand(c *rpc.Client) error {
redeemSize := estimateRedeemSerializeSize(cmd.contract, redeemTx.TxOut)
fee := txrules.FeeForSerializeSize(feePerKb, redeemSize)
redeemTx.TxOut[0].Value = cmd.contractTx.TxOut[contractOut].Value - int64(fee)
if txrules.IsDustOutput(redeemTx.TxOut[0], feePerKb) {
if txrules.IsDustOutput(redeemTx.TxOut[0], minFeePerKb) {
return fmt.Errorf("redeem output value of %v is dust", vtcutil.Amount(redeemTx.TxOut[0].Value))
}

Expand Down

0 comments on commit cce3608

Please sign in to comment.