Source:
<code>public boolean signInputs(ProposedTransaction propTx, KeyBag keyBag) { Transaction tx = propTx.partialTx; int numInputs = tx.getInputs().size(); for (int i = 0; i < numInputs; i++) { TransactionInput txIn = tx.getInput(i); if (txIn.getConnectedOutput() == null) { log.warn("Missing connected output, assuming input is already signed.", i); continue; } try { txIn.getScriptSig().correctlySpends(tx, i, txIn.getConnectedOutput().getScriptPubKey(), true); log.warn("Input already correctly spends output, assuming SIGHASH type used will be safe and skipping signing.", i); continue; } catch (ScriptException e) { } RedeemData redeemData = txIn.getOutpoint().getConnectedRedeemData(keyBag); ECKey key; if (redeemData == null || (key = redeemData.getFullKey()) == null) { log.warn("No local key found for input {}", i); continue; } Script scriptPubKey = txIn.getConnectedOutput().getScriptPubKey(); Script inputScript = txIn.getScriptSig(); byte[] script = redeemData.redeemScript.getProgram(); int keyIndex = redeemData.getKeyIndex(key); try { TransactionSignature signature = tx.calculateSignature(i, key, script, Transaction.SigHash.ALL, false); inputScript = scriptPubKey.getScriptSigWithSignature(inputScript, signature.encodeToBitcoin(), keyIndex); txIn.setScriptSig(inputScript); <START> if (key instanceof DeterministicKey) <END> propTx.keyPaths.put(txIn, (((DeterministicKey) key).getPath())); } catch (ECKey.KeyIsEncryptedException e) { throw e; } catch (ECKey.MissingPrivateKeyException e) { log.warn("No private key in keypair for input {}", i); } } return true; }</code><technical_language>keyPaths is updated in single-key case local signing is possible, in case, is for</technical_language>

Target:
public boolean signInputs(ProposedTransaction propTx, KeyBag keyBag) { Transaction tx = propTx.partialTx; int numInputs = tx.getInputs().size(); for (int i = 0; i < numInputs; i++) { TransactionInput txIn = tx.getInput(i); if (txIn.getConnectedOutput() == null) { log.warn("Missing connected output, assuming input is already signed.", i); continue; } try { txIn.getScriptSig().correctlySpends(tx, i, txIn.getConnectedOutput().getScriptPubKey(), true); log.warn("Input already correctly spends output, assuming SIGHASH type used will be safe and skipping signing.", i); continue; } catch (ScriptException e) { } RedeemData redeemData = txIn.getConnectedRedeemData(keyBag); ECKey key; if (redeemData == null || (key = redeemData.getFullKey()) == null) { log.warn("No local key found for input {}", i); continue; } Script scriptPubKey = txIn.getConnectedOutput().getScriptPubKey(); Script inputScript = txIn.getScriptSig(); byte[] script = redeemData.redeemScript.getProgram(); try { TransactionSignature signature = tx.calculateSignature(i, key, script, Transaction.SigHash.ALL, false); int sigIndex = redeemData.getKeyIndex(key); inputScript = scriptPubKey.getScriptSigWithSignature(inputScript, signature.encodeToBitcoin(), sigIndex); txIn.setScriptSig(inputScript); if (key instanceof DeterministicKey) propTx.keyPaths.put(txIn, (((DeterministicKey) key).getPath())); } catch (ECKey.KeyIsEncryptedException e) { throw e; } catch (ECKey.MissingPrivateKeyException e) { log.warn("No private key in keypair for input {}", i); } } return true; }