Basic support for version 2 transactions. Cherry pick bitcoinj@850f219

This commit is contained in:
Oscar Guindzberg 2018-12-13 16:42:46 -03:00
parent bb368d638c
commit b55073cf1b

View file

@ -113,6 +113,13 @@ public class BisqRiskAnalysis implements RiskAnalysis {
if (tx.getConfidence().getSource() == TransactionConfidence.Source.SELF) if (tx.getConfidence().getSource() == TransactionConfidence.Source.SELF)
return Result.OK; return Result.OK;
// Relative time-locked transactions are risky too. We can't check the locks because usually we don't know the
// spent outputs (to know when they were created).
if (tx.hasRelativeLockTime()) {
nonFinal = tx;
return Result.NON_FINAL;
}
if (wallet == null) if (wallet == null)
return null; return null;
@ -157,7 +164,7 @@ public class BisqRiskAnalysis implements RiskAnalysis {
*/ */
public static RuleViolation isStandard(Transaction tx) { public static RuleViolation isStandard(Transaction tx) {
// TODO: Finish this function off. // TODO: Finish this function off.
if (tx.getVersion() > 1 || tx.getVersion() < 1) { if (tx.getVersion() > 2 || tx.getVersion() < 1) {
log.warn("TX considered non-standard due to unknown version number {}", tx.getVersion()); log.warn("TX considered non-standard due to unknown version number {}", tx.getVersion());
return RuleViolation.VERSION; return RuleViolation.VERSION;
} }