| 1856 | */ |
| 1857 | |
| 1858 | bool CWallet::SignTransaction(CMutableTransaction& tx) const |
| 1859 | { |
| 1860 | AssertLockHeld(cs_wallet); |
| 1861 | |
| 1862 | // Build coins map |
| 1863 | std::map<COutPoint, Coin> coins; |
| 1864 | for (auto& input : tx.vin) { |
| 1865 | std::map<uint256, CWalletTx>::const_iterator mi = mapWallet.find(input.prevout.hash); |
| 1866 | if(mi == mapWallet.end() || input.prevout.n >= mi->second.tx->vout.size()) { |
| 1867 | return false; |
| 1868 | } |
| 1869 | const CWalletTx& wtx = mi->second; |
| 1870 | int prev_height = wtx.state<TxStateConfirmed>() ? wtx.state<TxStateConfirmed>()->confirmed_block_height : 0; |
| 1871 | coins[input.prevout] = Coin(wtx.tx->vout[input.prevout.n], prev_height, wtx.IsCoinBase()); |
| 1872 | } |
| 1873 | std::map<int, bilingual_str> input_errors; |
| 1874 | return SignTransaction(tx, coins, SIGHASH_DEFAULT, input_errors); |
| 1875 | } |
| 1876 | |
| 1877 | bool CWallet::SignTransaction(CMutableTransaction& tx, const std::map<COutPoint, Coin>& coins, int sighash, std::map<int, bilingual_str>& input_errors) const |
| 1878 | { |
no test coverage detected