1 diff --git a/src/main.cpp b/src/main.cpp
2 index 43bd5dd..b38ce88 100644
5 @@ -925,7 +925,7 @@ bool CWalletTx::AcceptWalletTransaction(bool fCheckInputs)
8 // Return transaction in tx, and if it was found inside a block, its hash is placed in hashBlock
9 -bool GetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlock, bool fAllowSlow)
10 +bool GetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlock, bool fAllowSlow, int height)
12 CBlockIndex *pindexSlow = NULL;
14 @@ -940,8 +940,8 @@ bool GetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlock
17 if (fAllowSlow) { // use coin database to locate block that contains transaction, and scan it
20 + int nHeight = height;
22 CCoinsViewCache &view = *pcoinsTip;
24 if (view.GetCoins(hash, coins))
25 diff --git a/src/main.h b/src/main.h
26 index d810bff..fba793c 100644
29 @@ -115,7 +115,7 @@ unsigned int ComputeMinWork(unsigned int nBase, int64 nTime);
30 int GetNumBlocksOfPeers();
31 bool IsInitialBlockDownload();
32 std::string GetWarnings(std::string strFor);
33 -bool GetTransaction(const uint256 &hash, CTransaction &tx, uint256 &hashBlock, bool fAllowSlow = false);
34 +bool GetTransaction(const uint256 &hash, CTransaction &tx, uint256 &hashBlock, bool fAllowSlow = false, int height = -1);
35 bool SetBestChain(CBlockIndex* pindexNew);
36 bool ConnectBestBlock();
37 CBlockIndex * InsertBlockIndex(uint256 hash);
38 diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp
39 index e82f4ad..624675f 100644
40 --- a/src/rpcrawtransaction.cpp
41 +++ b/src/rpcrawtransaction.cpp
42 @@ -134,7 +134,7 @@ void TxToJSON(const CTransaction& tx, const uint256 hashBlock, Object& entry)
44 Value getrawtransaction(const Array& params, bool fHelp)
46 - if (fHelp || params.size() < 1 || params.size() > 2)
47 + if (fHelp || params.size() < 1 || params.size() > 3)
49 "getrawtransaction <txid> [verbose=0]\n"
50 "If verbose=0, returns a string that is\n"
51 @@ -148,9 +148,13 @@ Value getrawtransaction(const Array& params, bool fHelp)
52 if (params.size() > 1)
53 fVerbose = (params[1].get_int() != 0);
56 + if (params.size() > 2)
57 + height = params[2].get_int();
60 uint256 hashBlock = 0;
61 - if (!GetTransaction(hash, tx, hashBlock, true))
62 + if (!GetTransaction(hash, tx, hashBlock, true, height))
63 throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "No information available about transaction");
65 CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION);