Commit Graph

17 Commits

Author SHA1 Message Date
Rusty Russell f24b73124a Remove txid normalization.
Since any transaction with all segregated-witness inputs is non-malleable,
and all our transactions are that, we can remove normalized txids.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-04-24 20:01:52 +09:30
Rusty Russell 85554761c8 bitcoind: eliminate wallet routines.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-04-24 19:51:35 +09:30
Rusty Russell e7b9a913a6 bitcoind: getrawblock helper.
It turns out using the verbose=false parameter, you can get the raw block
from getblock.  Do that.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-04-24 19:40:29 +09:30
Rusty Russell 14d722d48d bitcoind: pretend normalized txids are in the block.
This lets us live in a segwit world, before segwit.  It's a shim which we
can remove once we've changed all our outputs.

We need a few more sleeps in our test script, since we've slowed
things down by doing these calls for every tx in every block.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-04-24 19:38:13 +09:30
Rusty Russell 01e46d154e bitcoind: getchaintips support.
This allows us to sae the block topology in detail.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-04-24 19:36:13 +09:30
Rusty Russell f7d86da1b5 daemon: have user supply UTXO for enchor input.
This lets us ensure that anchor tx has witness scripts for inputs, and thus
is immalleable.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-04-12 13:07:04 +09:30
Rusty Russell e84bf16bf8 bitcoind: fee estimation support.
This can be used for proper support for fee negotiation; for the moment
it will be used for our anchor transaction creation.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-04-12 13:07:03 +09:30
Rusty Russell 95340aa03f bitcoind: use fundrawtransaction rather than sendtoaddress and -nowalletbroadcast
Luke-Jr points out this is the Right Way to do these things.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-04-11 16:40:53 +09:30
Rusty Russell 8f2e66089b daemon: add --bitcoin-datadir for bitcoin-cli.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-03-15 17:08:40 +10:30
Rusty Russell 27eedc9f51 patch bitcoind_get_mediantime.patch 2016-01-22 06:45:28 +10:30
Rusty Russell 6afe3f718d daemon: bitcoind callback gives the blockhash the tx was included in.
This is required for transactions which use OP_CSV to lock outputs for
a given amount of time: we need to know the mediantime of the block
they were included into.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-01-22 06:45:28 +10:30
Rusty Russell 0dbbd81430 bitcoind: tell bitcoind_poll_transactions's callback if tx is a coinbase.
In this case, the inputs aren't valid transactions, so don't try to
find them.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-01-22 06:41:49 +10:30
Rusty Russell 34e32978b8 bitcoind: warn if their bitcoin config doesn't have walletbroadcast=0.
Because we use the bitcoin wallet to create the anchor transaction, we
need to make sure it doesn't broadcast it; safest to check their config
for the option.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-01-22 06:41:49 +10:30
Rusty Russell c51a8d804f bitcoind: routine to send to a specific address.
We use this to create our anchor payment.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-01-22 06:41:49 +10:30
Rusty Russell d5328c7577 bitcoind: routine to broadcast a transaction.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-01-22 06:41:49 +10:30
Rusty Russell fc49e3fd74 daemon: rename 'state' to 'dstate' everywhere.
This is the daemon state, not the state machine state.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-01-22 06:41:49 +10:30
Rusty Russell 5ec8ff91e4 daemon/bitcoind: communication with bitcoind.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-01-22 06:41:49 +10:30