Allow re-signing of transactions and re-sign after adjusting the sequence number.

This commit is contained in:
Mike Hearn
2013-01-12 14:47:43 +01:00
parent 916e33254f
commit e4e4e45a47
2 changed files with 6 additions and 2 deletions

View File

@@ -424,10 +424,14 @@ public class WalletTool {
t.setLockTime(Transaction.parseLockTimeStr(lockTimeStr));
// For lock times to take effect, at least one output must have a non-final sequence number.
t.getInputs().get(0).setSequenceNumber(0);
// And because we modified the transaction after it was completed, we must re-sign the inputs.
t.signInputs(Transaction.SigHash.ALL, wallet);
}
} catch (ParseException e) {
System.err.println("Could not understand --locktime of " + lockTimeStr);
return;
} catch (ScriptException e) {
throw new RuntimeException(e);
}
t = req.tx; // Not strictly required today.
setup();