Skip to content

Commit

Permalink
upda
Browse files Browse the repository at this point in the history
  • Loading branch information
GalaxySciTech committed Aug 9, 2020
1 parent bdf305e commit 1432efb
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 31 deletions.
33 changes: 33 additions & 0 deletions src/main/java/org/consenlabs/tokencore/wallet/model/MultiTo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package org.consenlabs.tokencore.wallet.model;

/**
*
* Created by pie on 2020/8/9 18: 37.
*/
public class MultiTo{

public MultiTo(String to, long amount) {
this.to = to;
this.amount = amount;
}

private String to;

private long amount;

public String getTo() {
return to;
}

public void setTo(String to) {
this.to = to;
}

public long getAmount() {
return amount;
}

public void setAmount(long amount) {
this.amount = amount;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.consenlabs.tokencore.wallet.Wallet;
import org.consenlabs.tokencore.wallet.model.Messages;
import org.consenlabs.tokencore.wallet.model.Metadata;
import org.consenlabs.tokencore.wallet.model.MultiTo;
import org.consenlabs.tokencore.wallet.model.TokenException;

import java.io.IOException;
Expand Down Expand Up @@ -62,44 +63,14 @@ public BitcoinTransaction(List<MultiTo> multiToList, int changeIdx, long fee, Ar
this.outputs = outputs;
this.changeIdx = changeIdx;
multiToList.forEach(multiTo -> {
multiToAmount+=multiTo.amount;
multiToAmount += multiTo.getAmount();
});

if (amount < DUST_THRESHOLD) {
throw new TokenException(Messages.AMOUNT_LESS_THAN_MINIMUM);
}
}

public class MultiTo{

public MultiTo(String to, long amount) {
this.to = to;
this.amount = amount;
}

private String to;

private long amount;

public String getTo() {
return to;
}

public void setTo(String to) {
this.to = to;
}

public long getAmount() {
return amount;
}

public void setAmount(long amount) {
this.amount = amount;
}
}



@Override
public String toString() {
return "BitcoinTransaction{" +
Expand Down

0 comments on commit 1432efb

Please sign in to comment.