Skip to content

Commit

Permalink
fix tx validator bug
Browse files Browse the repository at this point in the history
  • Loading branch information
niels1286 committed Apr 22, 2022
1 parent 7047fce commit 49f036d
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ private void validateTxSignature(Transaction tx, TxRegister txRegister, Chain ch
}
}
for (CoinFrom coinFrom : coinData.getFrom()) {
if (tx.getType() == TxType.STOP_AGENT || tx.getType()==TxType.DELAY_STOP_AGENT) {
if (tx.getType() == TxType.STOP_AGENT || tx.getType() == TxType.DELAY_STOP_AGENT) {
//停止节点from中第一笔为签名地址, 只验证from中第一个
break;
}
Expand Down Expand Up @@ -476,7 +476,7 @@ private void validateTxSignatureProtocol12(Transaction tx, TxRegister txRegister
}
}
for (CoinFrom coinFrom : coinData.getFrom()) {
if (tx.getType() == TxType.STOP_AGENT || tx.getType()==TxType.DELAY_STOP_AGENT) {
if (tx.getType() == TxType.STOP_AGENT || tx.getType() == TxType.DELAY_STOP_AGENT) {
//停止节点from中第一笔为签名地址, 只验证from中第一个
break;
}
Expand All @@ -491,7 +491,7 @@ private void validateTxSignatureProtocol12(Transaction tx, TxRegister txRegister
do {
int txType = tx.getType();
// 质押和退出质押不验证锁定地址
if (txType == TxType.DEPOSIT || txType == TxType.CANCEL_DEPOSIT || txType == TxType.STOP_AGENT) {
if (txType == TxType.DEPOSIT || txType == TxType.CANCEL_DEPOSIT || txType == TxType.STOP_AGENT || txType == TxType.DELAY_STOP_AGENT) {
break;
}
boolean needAccountManagerSign = false;
Expand Down Expand Up @@ -641,7 +641,7 @@ private void validateCoinFromBase(Chain chain, TxRegister txRegister, List<CoinF
throw new NulsException(TxErrorCode.TX_VERIFY_FAIL);
}
}
if (null != existMultiSignAddress && type != TxType.STOP_AGENT && type != TxType.RED_PUNISH) {
if (null != existMultiSignAddress && type != TxType.STOP_AGENT && type != TxType.DELAY_STOP_AGENT && type != TxType.RED_PUNISH) {
//如果from中含有多签地址,则表示该交易是多签交易,则必须满足,froms中只存在这一个多签地址
for (CoinFrom coinFrom : listFrom) {
if (!Arrays.equals(existMultiSignAddress, coinFrom.getAddress())) {
Expand Down

0 comments on commit 49f036d

Please sign in to comment.