10 import urllib.parse
as urlparse
18 self.
nodes.append(
start_node(0, self.options.tmpdir, [
"-debug",
"-logtimemicros",
"-minrelaytxfee=0.00001"]))
19 self.
nodes.append(
start_node(1, self.options.tmpdir, [
"-debug",
"-logtimemicros"]))
34 assert(balance - newbalance < Decimal(
"0.001"))
37 url = urlparse.urlparse(self.
nodes[1].url)
41 nA = next(i
for i, vout
in enumerate(self.
nodes[0].
getrawtransaction(txA, 1)[
"vout"])
if vout[
"value"] == Decimal(
"10"))
42 nB = next(i
for i, vout
in enumerate(self.
nodes[0].
getrawtransaction(txB, 1)[
"vout"])
if vout[
"value"] == Decimal(
"10"))
43 nC = next(i
for i, vout
in enumerate(self.
nodes[0].
getrawtransaction(txC, 1)[
"vout"])
if vout[
"value"] == Decimal(
"10"))
47 inputs.append({
"txid":txA,
"vout":nA})
48 inputs.append({
"txid":txB,
"vout":nB})
57 nAB = next(i
for i, vout
in enumerate(self.
nodes[0].
getrawtransaction(txAB1, 1)[
"vout"])
if vout[
"value"] == Decimal(
"14.99998"))
61 inputs.append({
"txid":txAB1,
"vout":nAB})
62 inputs.append({
"txid":txC,
"vout":nC})
70 assert(newbalance == balance - Decimal(
"30") + Decimal(
"24.9996"))
77 self.
nodes[0]=
start_node(0, self.options.tmpdir, [
"-debug",
"-logtimemicros",
"-minrelaytxfee=0.0001"])
85 assert(newbalance == balance - Decimal(
"24.9996"))
89 assert(unconfbalance == newbalance)
91 assert(
not txABC2
in [utxo[
"txid"]
for utxo
in self.
nodes[0].
listunspent(0)])
98 assert(newbalance == balance + Decimal(
"30"))
103 self.
nodes[0]=
start_node(0, self.options.tmpdir, [
"-debug",
"-logtimemicros",
"-minrelaytxfee=0.00001"])
112 assert(newbalance == balance - Decimal(
"20") + Decimal(
"14.99998"))
118 assert(newbalance == balance - Decimal(
"10") - Decimal(
"14.99998") + Decimal(
"24.9996"))
123 self.
nodes[0]=
start_node(0, self.options.tmpdir, [
"-debug",
"-logtimemicros",
"-minrelaytxfee=0.0001"])
126 assert(newbalance == balance - Decimal(
"24.9996"))
132 inputs.append({
"txid":txA,
"vout":nA})
145 assert(newbalance == balance + Decimal(
"20"))
154 print "If balance has not declined after invalidateblock then out of mempool wallet tx which is no longer" 155 print "conflicted has not resumed causing its inputs to be seen as spent. See Issue #7315" 156 print balance ,
" -> " , newbalance ,
" ?" 158 if __name__ ==
'__main__':
UniValue abandontransaction(const UniValue ¶ms, bool fHelp)
UniValue getunconfirmedbalance(const UniValue ¶ms, bool fHelp)
UniValue getbalance(const UniValue ¶ms, bool fHelp)
UniValue getrawtransaction(const UniValue ¶ms, bool fHelp)
UniValue listunspent(const UniValue ¶ms, bool fHelp)
UniValue sendtoaddress(const UniValue ¶ms, bool fHelp)
def connect_nodes(from_connection, node_num)
UniValue disconnectnode(const UniValue ¶ms, bool fHelp)
UniValue getnewaddress(const UniValue ¶ms, bool fHelp)
def sync_mempools(rpc_connections, wait=1)
UniValue signrawtransaction(const UniValue ¶ms, bool fHelp)
UniValue createrawtransaction(const UniValue ¶ms, bool fHelp)
def start_node(i, dirname, extra_args=None, rpchost=None, timewait=None, binary=None)
UniValue generate(const UniValue ¶ms, bool fHelp)
UniValue sendrawtransaction(const UniValue ¶ms, bool fHelp)
def sync_blocks(rpc_connections, wait=1)
UniValue getrawmempool(const UniValue ¶ms, bool fHelp)
UniValue getbestblockhash(const UniValue ¶ms, bool fHelp)